Eyeon:Script/Reference/Applications/Fusion/Classes/Composition/MapPath
From VFXPedia
Contents |
Composition : MapPath
Arguments
result = MapPath(path)
- path (required, string)
A file or directory path that can contain Fusion's path maps.
Returns
- result (string)
A file or directory path with all path maps expanded into their literal path equivalents.
Remarks
There are a number of default and user-specified path maps within Fusion that are intended to provide convenient ways to access common locations, or for flexibility in scripting. These can be any string, but often end in a colon, e.g. Fusion:, Comp:. They are expanded into a literal path as specified by the Path Maps preferences page.
However, many Fusion functions (and all Lua functions) require strictly literal paths. MapPath() can be used to easily convert any path map into a fully-expanded literal path. If there is no path map at the beginning of the path, MapPath() will just return the unchanged path.
In addition to expanding all global path maps like Fusion:MapPath(), Composition:MapPath() will also expand any path maps listed in the composition's Path Map preferences, and the following built-in defaults:
comp: | The directory that contains the saved composition |
Requirements
- eyeonScript 5.0
- Fusion 5.0
See Also
ReverseMapPath()
Fusion:MapPath()
Examples
print(composition:MapPath("Comp:\\footage\\file0000.tga"))
Result:
\\fileserver\Share\Projects\Shot\Comp5\footage\file0000.tga
Tips for MapPath (edit)
- Fusion 6.2 build 897 added MapPathSegments to work with strings that contain multiple directories. The return value is a table with all expanded paths while MapPath only expands the first segment and discards the rest.
==comp:MapPath("AllDocs:Settings;Fusion:Settings") C:\Users\Public\Documents\eyeon\Fusion\Settings\ ==comp:MapPathSegments("AllDocs:Settings;Fusion:Settings") table: 0000000007889D40 1 = C:\Users\Public\Documents\eyeon\Fusion\Settings 2 = C:\Program Files\eyeon\Fusion 6.2\Settings