File and node naming
Planning the file and node naming conventions for the parent scenes and referenced files is important and will greatly add to the success of the implementation of file referencing in your production environment. In particular plan to ensure that:
- All files are uniquely named: the same file name should not be used more than once in any project. When Maya doesn't find a file that it is looking for, it will look in other places relative to the current project, and as specified by the current environment variables that may have been set. For example, a project could have numerous files called light.ma; a desk light, a streetlight, and a low resolution (light poly count) version of a character. To prevent any file referencing ambiguities, these files should be more explicitly named: deskLight.ma, streetLight.ma, and lightCharRig.ma.
- If possible, you should avoid naming files so that file names begin with a number. If you try to reference the file from the command line, you may experience problems. For more information, see Executing system commands.
- The
Use Namespaces option is turned on when first referencing a file to ensure all nodes within a file are explicitly and uniquely named. For example, an object named tree1 within a file called mapleTree will have a node named mapleTree:tree1 when the file is referenced into the parent scene. The other nodes associated with that object will also be named in a similar manner. For more information, see
Namespaces.
Alternatively, you can specify namespaces of shorter length than the default file name when it makes sense. A shorter node name streamlines your workflow when working with Maya's editors (Channel Box, Outliner, Layer Editor, and so on). You create a custom namespace by typing the desired text string in the Create Reference option window. For example, you could select to use a custom namespace called mt instead of the word mapleTree. The tree1 node name in the above example would be called mt:tree1. This reduces the length of the name (and any typing) that may be required when working in Maya.
Note: If you create a reference with the namespace option, a namespace is created. This is ensures that none of the referenced nodes have name clashes with any existing nodes. Removing that reference should remove the associated namespace.If you add non-referenced nodes to the reference namespace, this can cause name clashes with referenced nodes (for example, if the reference is unloaded when a node is added to the namespace), and prevents the namespace from being deleted when the reference is removed. For more information, see Namespaces.
Note:Namespaces are the preferred method for managing naming when working with file references in Maya. It is not recommended that you employ Maya's renaming prefix convention when using file referencing. While the DAG path or long name of a node may make it unique when using renaming prefixes they do not work consistently within file referencing and will complicate the hierarchical DAG changes which causes problems later on.
File formats
Saving files in the Maya ascii file format (.ma) is preferred when using file referencing. Maya ascii files can be opened and edited in your favorite text editor, and are easier to troubleshoot if the file or some components of the file do not load as expected.
It is not recommended that you reference files in other file formats (for example, dxf, obj, wire, and so on) when using file referencing. When possible convert files to a native Maya format by loading and resaving files in the .ma format.
File paths
File referencing only supports absolute paths and paths with environment variables. Relative path names are not supported when using file referencing. An environment variable can be used as a superior alternative to a relative path as it is explicit and customizable to each user's file structure.
Relative path (not supported):
scenes/street.ma
Absolute path (supported): C:/projects/cityscene/scenes/street.ma
Environment variable path (supported): $myProject/scenes/street.ma
For more information on environment variables see Setting environment variables using Maya.env.
For more information, see Edit reference paths in the Reference Editor.
Scenes with render setup nodes
You should save your scene with the scene layer set as visible. This avoids render setup overrides from your active render layer to be automatically applied when you import or reference this scene into another.