When you save USD file(s) as relative to your Maya scene file, you can enable ease of access and with project handoffs of your Maya scene file. Relative pathing is especially useful in the case of if you would like to send a Maya scene file alongside a USD root file to another artist in another location. That artist will be able to open the Maya scene file and the USD layer files will be fully functional and portable alongside the Maya scene file.
When you choose any of the following save/load processes for your root USD file, you can access the toggle to enable relative pathing:
Choose File > Save As, then select the icon next to an anonymous root layer
In the USD Layer Editor right-click an anonymous root layer > click Save As
In the USD Layer Editor > choose the bulk save icon > click on the folder icon beside the root layer (typically called anonymousLayer1
)
In the Attribute Editor, when a stage is loaded, select the folder icon for the Stage Source File input to load in a USD file
Choose Create > Universal Scene Description > Stage from File >
In the USD Layer Editor, select Create > Stage from File >
With any of the above save/load processes, the following toggle appears beside your directory, under the heading File Options:
Make Path Relative to Scene File: This toggle is unchecked by default and when off, your root file is an absolute path. If enabled, the path will be relative to your Maya scene file.
When you have a chosen directory, your USD file named, and have Make Path Relative to Scene File enabled, your USD file will be relative to where your saved Maya scene file is located. To verify or edit between absolute/relative path for your stage source file, you can choose the folder icon under Stage Source in the Attribute Editor, make changes to the toggle and then reload the stage source/ file path to enact changes.
When adding a USD reference, you can load it relatively to where it will be defined in (the edit target layer).
Right click a USD prim and select Add USD Reference/Payload... > in the Add Reference to USD Prim reference dialog under File Options:
Enable Make Path Relative to Edit Target Layer Directory: Enable this toggle to activate relative pathing to your current edit target layer’s directory. Once this option is enabled, verify that your target layer is not anonymous and save it to disk so your relative path selection can be enacted.
When saving any anonymous sublayer, you can save it relative to your parent layer directory in one of the following methods:
Right-click on an anonymous sublayer > select Save As
In the USD Layer Editor > choose the bulk save icon > click on the folder icon beside the anonymous sublayer
In the USD Layer Editor > choose the load sublayer icon > click on the folder icon beside the anonymous sublayer OR have a layer selected and right-click > Load Sublayers... from the contextual menu
In the Load Layers/ Load Sublayer(s) to <LayerName>
dialog under File Options:
Enable Make Path Relative to Parent Layer Directory: Enable to activate relative pathing to your current parent layer’s directory. Once this option is enabled, verify that your parent layer is not anonymous and save it to disk so your relative path selection can be enacted.
Shift
or Control
to select multiple files and have them populate in the Load Layers dialog browser when complete.anonymouslayer1
). anonymouslayer1
). The Set As dialog appears. Here you can name your file, locate a directory and select Make Path Relative to Scene File. Choose a directory, name the file and click Set. Then, in the bulk save dialog, you will see the path populated beside anonymousLayer1
is the file name only.
Tip: if you hover over your root layer (anonymouslayer1
), you can see the tooltip indicating the directory or resolved path for your Maya scene file if it has been saved to disk.
..\..\layer1.usd
. This path and it's child layer's tooltip will update. This ensures your parent layer directory is mapped and any descendants when set as relative can be directed to that. As such, any parent/child layer directories sync updates as you toggle these checkboxes.