Difference between revisions of "Path Aliases"

From The Foundry MODO SDK wiki
Jump to: navigation, search
m (Added an example for adding an Alias to the a config file and how to query it using python.)
Line 7: Line 7:
 
''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>
 +
</tabber>
 
== More Information ==
 
== More Information ==
 
* [[PlatformService Reference]]
 
* [[PlatformService Reference]]
  
 
[[Category: Top level]]
 
[[Category: Top level]]

Revision as of 16:49, 4 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:')

</tabber>

More Information