Skip to content

EMSUSD-4347 fix duplication of render prims and classes - #4875

Merged
seando-adsk merged 3 commits into
devfrom
bailp/EMSUSD-4347/dup-render-prim
Nov 27, 2026
Merged

seando-adsk merged 3 commits into
devfrom
bailp/EMSUSD-4347/dup-render-prim

Conversation

@pierrebai-adsk

Copy link
Copy Markdown
Collaborator

There were two bug.

One was that when duplicating in the session layer, the prim was initially created without prim type, which made it being filtered out by the outliner. That is, the code used to try to create the parent hierarchy if it did not exist but accidentally also create the prim, but without type. Since the outliner only updates when a prim is added, by the time the prim type was set the outliner had already reacted to the add notification.

The second was that the copying process was searching for a "def" and failed if not found, but class prim don't have a "def", they have a "class".

  • Modified the commands to not create the prim as typeless when in a session layer.
  • Allow finding a class prim spec.
  • Added unit tests.

There were two bug.

One was that when duplicating in the session layer, the prim was initially created without prim type, which made it being filtered out by the outliner. That is, the code used to try to create the parent hiearchy if it did not exist but accidentally also create the prim, but without type. Since the outliner only updates when a prim is added, bhy the time the prim type was set the outliner had already reacted to the add notification.

The second was that the copying process was searching for a "def" and failed if not found, but class prim don't have a "def", they have a "class".

- Modified the commands to not create the prim as typeless when in a session layer.
- Allow finding a class prim spec.
- Added unit tests.
@pierrebai-adsk pierrebai-adsk added bug Something isn't working ufe Related to UFE component in Maya Render Setup labels Nov 25, 2026
@pierrebai-adsk pierrebai-adsk self-assigned this Nov 25, 2026
@AramAzhari-adsk
AramAzhari-adsk requested a max review from Copilot November 25, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Class-handling changes can delete unrelated or untargeted stronger-layer specs and overwrite class definitions, causing loss of properties and children.

5 open issues
What changed in this PR

This PR addresses duplication of session-layer render prims and class prims in Maya USD, updating shared scene-editing commands and adding regression coverage.

Changes:

  • Create only destination parents before copying session-layer prims, avoiding premature typeless creation.
  • Allow defining-spec lookup to return a class spec when no definition spec exists.
  • Add C++ and Python tests for duplication, parenting notifications, and class duplication with undo/redo.
File Description
test/​lib/​usdUfe/​testDuplicateCommand.cpp Adds duplication and class-spec lookup tests.
test/​lib/​usdUfe/​CMakeLists.txt Registers the new C++ test target.
test/​lib/​ufe/​testParentCmd.py Adds session-layer parenting notification coverage.
test/​lib/​ufe/​testDuplicateCmd.py Adds notification and class duplication tests.
lib/​usdUfe/​utils/​layers.h Documents the class-spec fallback.
lib/​usdUfe/​utils/​layers.cpp Implements definition-first, class-fallback lookup.
lib/​usdUfe/​ufe/​UsdUndoInsertChildCommand.cpp Limits session-layer precreation to destination parents.
lib/​usdUfe/​ufe/​UsdUndoDuplicateCommand.cpp Updates shared duplication to precreate only parents.
lib/​mayaUsd/​ufe/​UsdUndoDuplicateCommand.cpp Applies the same precreation change to Maya duplication.

Review effort: Max

Comment thread lib/usdUfe/utils/layers.cpp Resolved
Comment thread lib/usdUfe/utils/layers.cpp Resolved
Comment thread test/lib/ufe/testParentCmd.py Resolved
Fixed that the non-Maya duplicate command and the insert-child command were ot teating teh session layer correctly.

Made the edit restriction take into consideration class prims.

Avoid using prim specs from inhierit or specialize as the defining spec.
@pierrebai-adsk
pierrebai-adsk force-pushed the bailp/EMSUSD-4347/dup-render-prim branch from 1322675 to 8663a03 Compare November 25, 2026 15:45
@pierrebai-adsk pierrebai-adsk self-assigned this Nov 25, 2026
Delay the UFE notification during duplicate so that the outliner sees teh fully-copied prim.
@pierrebai-adsk
pierrebai-adsk force-pushed the bailp/EMSUSD-4347/dup-render-prim branch from 8663a03 to 118ca27 Compare November 25, 2026 17:17
@pierrebai-adsk

Copy link
Copy Markdown
Collaborator Author

Fixed the issues found by copilot, ready to review

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 26, 2026
@seando-adsk seando-adsk added workflows Related to in-context workflows and removed bug Something isn't working ufe Related to UFE component in Maya Render Setup labels Nov 27, 2026
@seando-adsk
seando-adsk merged commit ee194eb into dev Nov 27, 2026
13 checks passed
@seando-adsk
seando-adsk deleted the bailp/EMSUSD-4347/dup-render-prim branch November 27, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants