maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

Edit Routing is not using when moving a prim using viewport manipulator

Open ika-rporter opened this issue 1 year ago • 1 comments

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

  1. Open USD Layer Editor
  2. Create > Stage with New Layer
  3. Set the edit target to the root layer
  4. Create an Xform prim in the root layer
  5. Register an 'attribute' edit router (see below)
  6. Select the prim, activate the move tool, and move the prim.
  7. Observe the xformOp opinions were written to the root layer, not the session layer.
  8. Edit the xformOp:translate attribute in the Channel Box
  9. 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

ika-rporter avatar Feb 24 '24 00:02 ika-rporter

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.

wallworm avatar Feb 29 '24 21:02 wallworm