Difference between revisions of "Path Aliases"

From The Foundry MODO SDK wiki
Jump to: navigation, search
(Created page with "== Path Aliases == ''modo'' supports arbitrary path aliases through the ''Path Alias'' preferences. These aliases provide OS-agnostic shortcuts to location in the file system...")
 
m (Querying Path Aliases)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Path Aliases ==
 
== Path Aliases ==
''modo'' supports arbitrary path aliases through the ''Path Alias'' preferences.  These aliases provide OS-agnostic shortcuts to location in the file system.  Each alias is in the form of ''alias:'', and resolves to an absolute path.  These are commonly used to provide custom mappings so that content can easily be shared between users.  Path aliases are stored in [[Config Files|configs]].
+
''modo'' supports arbitrary path aliases through the ''Path Alias'' preferences.  These aliases provide OS-agnostic shortcuts to location in the file system.  Each alias is in the form of ''alias''':''''' (note the colon symbol after the alias), and resolves to an absolute path.  These are commonly used to provide custom mappings so that content can easily be shared between users.  Path aliases are stored in [[Config Files|configs]].
  
 
[[Scripting|Scripts]] and [[SDK|plug-ins]] can resolve path aliases into their absolute paths through the [[PlatformService Reference|platformservice]] [[ScriptQuery Overview|ScriptQuery interface]].
 
[[Scripting|Scripts]] and [[SDK|plug-ins]] can resolve path aliases into their absolute paths through the [[PlatformService Reference|platformservice]] [[ScriptQuery Overview|ScriptQuery interface]].
Line 6: Line 6:
 
== Standard Paths ==
 
== Standard Paths ==
 
''modo'' uses a number of standard paths for its configuration files, content, help and other resources.  These are detailed in the [[Path Aliases: Standard Paths]] article.
 
''modo'' uses a number of standard paths for its configuration files, content, help and other resources.  These are detailed in the [[Path Aliases: Standard Paths]] article.
 +
 +
== Adding Aliases to a Config File ==
 +
<syntaxhighlight language="xml">
 +
<atom type="PathAliases">
 +
  <hash type="Alias" key="pathAliasName">
 +
    <atom type="Path">C:\path\to\desired\folder</atom>
 +
  </hash>
 +
</atom>
 +
</syntaxhighlight>
 +
 +
== Querying Path Aliases ==
 +
 +
<tabber>
 +
Python=
 +
<syntaxhighlight lang="python">
 +
# python
 +
fileService = lx.service.File()
 +
aliasPath = fileService.ToLocalAlias('pathAliasName:')
 +
</syntaxhighlight>
 +
|-|
 +
LXMacro=
 +
<syntaxhighlight lang="python">
 +
#LXMacro#
 +
query platformservice alias ? "pathAliasName:"
 +
</syntaxhighlight>
 +
</tabber>
  
 
== More Information ==
 
== More Information ==

Latest revision as of 14:45, 5 April 2018

Path Aliases

modo supports arbitrary path aliases through the Path Alias preferences. These aliases provide OS-agnostic shortcuts to location in the file system. Each alias is in the form of alias: (note the colon symbol after the alias), and resolves to an absolute path. These are commonly used to provide custom mappings so that content can easily be shared between users. Path aliases are stored in configs.

Scripts and plug-ins can resolve path aliases into their absolute paths through the platformservice ScriptQuery interface.

Standard Paths

modo uses a number of standard paths for its configuration files, content, help and other resources. These are detailed in the Path Aliases: Standard Paths article.

Adding Aliases to a Config File

<atom type="PathAliases">
  <hash type="Alias" key="pathAliasName">
    <atom type="Path">C:\path\to\desired\folder</atom>
  </hash>
</atom>

Querying Path Aliases

<tabber>

Python=
 # python
 fileService = lx.service.File()
 aliasPath = fileService.ToLocalAlias('pathAliasName:')

|-|

LXMacro=
 #LXMacro#
 query platformservice alias ? "pathAliasName:"

</tabber>

More Information