Edit routing

What is edit routing

Currently, when typically modifying USD data, the modifications are written to the current edit target layer (ie. the current targeted layer) by default. The current layer is selected in the Layer Editor window in Maya.

Edit routing is a mechanism to select which USD layer will receive edits. When a routable edit is about to happen, the Maya USD plug-in can temporarily change the targeted layer so that the modifications are written to a specific layer, instead of the current target layer.

The mechanism allows advanced users to write code (scripts or plug-ins) to handle the routing. The script receives information about which USD prim is about to be change and the name of the operation that is about to modify that prim. In the case of attribute changes, the name of the attribute is also provided.

Given this information, the script can choose a specific layer among the available layers. Edit routing is divided in two categories: commands and attributes.

Enable edit routing

To work with edit routing and learn more about usage, see the following Github documentation topic and code from the Github repository. Note: The edit routing toggle will persist across Maya sessions.

Edit routing use cases

As a pipeline TD or advanced user, you can use edit routing to:

When Routing Edits is enabled for the visibility command (ie. after enabling the edit routing via script, setting the visibility attribute for a prim), you will now have visibility opinions in the session layer. Now you can work in this target layer (ie. layout.usd) and be able to rename/reparent/regroup the prim without being restricted by MayaUSD Default Restrictions. After the rename/reparent/regroup, the visibility opinions will still apply to the newly edited prim and you can continue working.

Important:

Your session layer will stay in sync when removing, reparenting, or grouping prims when edit routing is enabled. When the session layer has an opinion of a prim and that prim gets removed/reparented/regrouped, the result will also happen in the session layer.

Note:

Within the edit router, the Maya SDK, UFE and MayaUsd callbacks are accessible. If the edit router needs more information, it can retrieve it by calling the provided SDK.