Repository navigation
EMSUSD-4347 fix duplication of render prims and classes - #4875
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
🟡 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
Merge existing session-layer spec before removing source class · New Account for class specs in command restriction checks · New Exclude inherited class specs from defining-prim fallback · New Publish destination only after its defining type is present · New Set root edit target to exercise the copy path · New
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
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
force-pushed
the
bailp/EMSUSD-4347/dup-render-prim
branch
from
November 25, 2026 15:45
1322675 to
8663a03
Compare
Delay the UFE notification during duplicate so that the outliner sees teh fully-copied prim.
pierrebai-adsk
force-pushed
the
bailp/EMSUSD-4347/dup-render-prim
branch
from
November 25, 2026 17:17
8663a03 to
118ca27
Compare
Collaborator
Author
|
Fixed the issues found by copilot, ready to review |
AramAzhari-adsk
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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".