Autodesk / Autodesk/maya-usd

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

Open
#3,632 1 comment 0 reactions 1 assignee Claimed by @santosg87 View on GitHub
bug
Dominant language
Wolfram Language
Stars
905
Forks
223
Avg merge
2d 9h
Merged PRs (30d)
17

Description

**Describe the bug**
If you register an 'attribute' edit router like [routeToSessionLayer](https://github.com/Autodesk/maya-usd/blob/e5811448ce8564a8a49eea46176b261a1f3adb48/doc/EditRouting.md#attributes) 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.

```python
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.