Proxy referencing tips

 
 
 

Replace reference vs. proxy references

The Reference Editor provides two methods for substituting file references within the parent scene. Each method has its advantages and limitations.

The Replace Reference command opens a file browser to replace the current reference with another you select. The group node and/or locator remains the same. Any edits that exist for the file reference at the parent scene level will be applied to the substituted file reference because the reference node is not modified. While this works well in situations where the file reference being substituted has exactly the same node names and DAG hierarchy as the original file reference, it has limited applications. If the node names and DAG hierarchy are not identical, you may encounter errors when Maya tries to apply the reference edits to the substituted reference and data loss could result. Maya doesn’t track the substitutions that occur when using the Replace Reference command and is not recommended when nested file references exist in the referencing hierarchy.

Proxy References allow you to substitute one or more file references by creating a set of possible substitute references (proxies) for a given file reference. A new node is created to keep track of the multiple proxies. Proxy references let you globally substitute many proxy references at a time by selecting the proxy references and reloading them based on their proxy tag. This is advantageous when you quickly need to substitute from a low resolution version of the scene to a high resolution version, and vice versa.

Sharing animation between proxy references

If you want to share animation between proxy references for a particular file reference you must ensure that a state of equivalency exists between the various proxy files for a particular file reference and their parent scene. That is, when you keyframe within the parent scene, you want to ensure that the animation can be applied to the correct nodes regardless of which proxy file is loaded. To achieve this equivalency, the proxy files must be set up as follows:

Rendering with proxy references

When rendering a scene that contains file and proxy references, only the currently loaded file and proxy references will render in the image unless you specify otherwise. You must ensure you load any references you want to appear in the rendering prior to rendering. You can switch proxies for the purposes of rendering using Pre Render MEL and Post Render MEL scripts.

For example, a low resolution proxy is currently displayed in the scene and needs to be switched to the high resolution version prior to rendering and then back to the low resolution version after the rendering is complete. By determining the name of the proxy manager in the Reference Editor, you can then determine the names of the related proxy set nodes for each proxy, and then create a simple script for switching between the low and high resolution versions of the proxies before and after rendering.

Example

The following workflow describes one method for switching between proxy references before and after rendering:

  • Determine the name of the proxy manager node by viewing the name in the Reference Editor. In this example, the proxy manager is named treePM.
  • Select the proxy manager node, so you can determine the individual proxy nodes by viewing the dependency graph for the selected node within the Hypergraph. You can select the proxy manager node by typing select -replace treePM in the command line. In this example, the nodes that appear downstream of treePM are called treeRN and treeloRN (where treeRN is the original high resolution file reference, and treeloRN is the low resolution proxy).
  • Create simple pre and post render MEL scripts to switch between the low and high resolution versions as follows:

    Pre-render script:

    //switch to the high res version

    proxySwitch treeRN;
    

    Post-render script:

    //switch to the low res version

    proxySwitch treeloRN;
    
    Note

    Multiple proxy references can be switched using the above technique. That is, multiple proxySwitch lines could be added to each script to load or unload several proxies at once.