Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-129169 correctly duplicate prim #3079

Merged
merged 3 commits into from
May 12, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

Correctly handle all these case:

  • Simple prim with a single opinion: simple copy of source layer into destination layer.
  • Prim with opinion in multiple local layers: marge all opinion in destination layer.
  • Prim containing a USD reference: keep the reference but do not copy the reference contents into the destination layer.
  • Prim containing a USD payload: keep the payload but do not copy the payload contents into the destination layer.
  • Prim inside a reference or payload: copy the reference or payload contents in the destination layer.

The code changes are:

  • Move layer-related function from the geneic util.h header and C++ file to the more specific utils/layers.h header and C++ file.
  • Make the getLocalPrimStack function available publicly.
  • Add getPrimStackForLayers function to find where a prim has opinions in a setof layers.
  • Add a description for the USD implementation of the UFE duplicate command.
  • It explains that the command copies the local opinions of the prim where it is defined.
  • Add a unit test that verify that duplicating a prim containing a USD reference does not copy the contents of the reference in the copy.
  • Remove the LayerAndPath type and replace it with PrimSpecHandle.
  • Prim spec contain the necessary data, and more, so it is more versatile.
  • Change some function names to be clearer.

Correctly handle all these case:
- Simple prim with a single opinion: simple copy of source layer into destination layer.
- Prim with opinion in multiple local layers: marge all opinion in destination layer.
- Prim containing a USD reference: keep the reference but do not copy the reference contents into the destination layer.
- Prim containing a USD payload: keep the payload but do not copy the payload contents into the destination layer.
- Prim inside a reference or payload: copy the reference or payload contents in the destination layer.

The code changes are:
- Move layer-related function from the geneic util.h header and C++ file to the more specific utils/layers.h header and C++ file.
- Make the getLocalPrimStack function available publicly.
- Add getPrimStackForLayers function to find where a prim has opinions in a setof layers.
- Add a description for the USD implementation of the UFE duplicate command.
- It explains that the command copies the local opinions of the prim where it is defined.
- Add a unit test that verify that duplicating a prim containing a USD reference does not copy the contents of the reference in the copy.
- Remove the LayerAndPath type and replace it with PrimSpecHandle.
- Prim spec contain the necessary data, and more, so it is more versatile.
- Change some function names to be clearer.
Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

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

Looks good

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label May 11, 2023
@@ -32,6 +32,17 @@ namespace MAYAUSD_NS_DEF {
namespace ufe {

//! \brief UsdUndoDuplicateCommand
//!
//! \details The USD duplicate command copies all opinions related the the USD prim
Copy link
Collaborator

Choose a reason for hiding this comment

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

small typo -> double "the"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm okay if you fix this in a follow-up PR.

@seando-adsk seando-adsk merged commit 1769e34 into dev May 12, 2023
@seando-adsk seando-adsk deleted the bailp/MAYA-129169/dup-copy-local-layer-stack branch May 12, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin composition arc ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants