maya-usd
maya-usd copied to clipboard
Edit Routing is not using when moving a prim using viewport manipulator
Describe the bug If you register an 'attribute' edit router like routeToSessionLayer from the examples, it is only called when editing an attribute through the Channel Box or Attribute Editor, not when moving a prim using the manipulator (eg, move tool). I
Steps to reproduce
- Open USD Layer Editor
- Create > Stage with New Layer
- Set the edit target to the root layer
- Create an Xform prim in the root layer
- Register an 'attribute' edit router (see below)
- Select the prim, activate the move tool, and move the prim.
- Observe the xformOp opinions were written to the root layer, not the session layer.
- Edit the xformOp:translate attribute in the Channel Box
- Observe an xformOp opinion is written to the session layer.
At this point, you also lose the ability to use the manipulator when the root layer is the edit target, but a stronger opinion exists in the session layer.
import mayaUsd.lib
def routeAttrToSessionLayer(context, routingData):
prim = context.get('prim')
if prim is not None:
routingData['layer'] = prim.GetStage().GetSessionLayer().identifier
mayaUsd.lib.registerEditRouter('attribute', routeAttrToSessionLayer)
Expected behavior An 'attribute' edit router should be called when using a manipulator (eg, move tool) to author xformOp opinions, in addition to when using the Channel Box or Attribute Editor.
Specs (if applicable):
- CentOS 7
- Maya 2023.3
- MayaUSD 0.26.0
- USD 0.21.11
This is a known limitation of Edit Routing and fixing it is on our radar. Some fixes, like this one, require changes to Maya itself to make it UFE-aware (and knowledgeable of our plugin). If/when we get to this, it will not be a backward-compatible feature in the USD toolset.