I’m looking for a method of specifying a path via some sort of parameter expansion.
E.g. instead of c:\myfolder\myfile.png
I’d like to say $ROOT\myfile.png
So as to avoid including the root directory in the scene itself. The idea is to facilitate distributed work, for example by hosting the project in a Dropbox directory, where everyone has different locations at which Dropbox is located.
Does anyone know if this is possible, or know of an alternative technique?
By the looks of it, it works just like that! Except variables are referenced via “$” on both Windows and Unix.
$ set ROOT=c:\myroot
$ maya
Then in Maya, set a file path to any node to:
$ROOT\myfile.png
I’m having trouble Googling this feature, does anyone know how long it’s been supported? In the Reference Editor, it gives you a preview of what a path containing environment variables resolves into. Is anyone using this to in production?
Yeah, we use environment variables for that.
Though the syntax is what you had in your first post.
For example one of our animation files would be referencing its rig from:
“$PROJECT_FILES/Rigs/Soldier_Rig_3p.ma”
Which references the its skinned mesh from:
“$PROJECT_FILES/Characters/Meshes/Soldier_Mesh_Skinned.ma”
Which could be referencing a texture:
“$PROJECT_FILES/Characters/Meshes/Soldier_Diffuse.TGA”
And as long as Maya can properly resolve these, and nobody decides to save them as resolved paths, they let folks work on the same files without having to enforce that everyone setup their Perforce workspaces in an identical manner. (Though to help keep these functioning, we’ve got a bunch of error checking scripts that will fix up the references paths, or at the very least let the user know that thing they just did is going to cause a headache for the next person wh uses the scene)