Edit reference paths in the Reference Editor
 
 
 

You can edit reference paths in the Reference Editor. You can optionally specify a reference using an environment variable.

To edit a reference path

  1. Open the Reference Editor by selecting File > Reference Editor or Panels > Panel > Reference Editor in the scene view.
  2. In the Unresolved Name text box, type the new path or enter an environment variable, and click Reload to load the reference from that location.

    If Maya cannot find the referenced file in the specified location, it looks in several default locations to find the file.

Customize the Unresolved name with a prefix of your choice

You can run this Python script to customize the Unresolved name field so that, instead of the absolute path, the file path is displayed with a prefix of your choice.

import os.path
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMaya as OpenMaya
mel.eval('string $MyScenes; putenv $MyScenes "C:/Documents and Settings/admin/My Documents/maya/projects/default/scenes/"')
def foo(retCode, fileObject, clientData):
     print "Callback was given %s" % fileObject.rawFullName()
     rel = "$MyScenes/"
     rel = rel + (os.path.basename(fileObject.rawFullName()))
     print "Callback changed this to %s" % rel
     fileObject.setRawFullName(rel)
     OpenMaya.MScriptUtil.setBool(retCode, True)
id = OpenMaya.MSceneMessage.addCheckFileCallback(OpenMaya.MSceneMessage.kBeforeReferenceCheck, foo)
# for deleting the callback 
OpenMaya.MMessage.removeCallback(id)
NoteRelative path names are not supported when using file referencing. Another alternative is to use environment variables to customize the display of your file paths.

Related topics