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

EMSUSD-85 - As a user, I'd like my 'Merge as USD' edits to be specified as overs when authoring to a stronger layer #3173

Merged
merged 3 commits into from
Jun 20, 2023

Conversation

vlasovi
Copy link
Collaborator

@vlasovi vlasovi commented Jun 19, 2023

Behaviour of the function mergePrims in MergePrims.cpp was changed:
Before, the function SdfJustCreatePrimInLayer was called for the prim's parent. This way the required "overs" were created up to the prim's parent and therefore the prim itself was created as "def"
Now, we call SdfJustCreatePrimInLayer for the prim itself. This way we create all required "overs" including the prim itself, which is the right behaviour.

… overs but the node being copied as well, if required
@pierrebai-adsk
Copy link
Collaborator

That's a clever solution, but I do wonder what happens when we merge to the layer where the prim is defined. Do the "over" get merged and now the prim is pure-over and maybe does not exists anymore? I would like you to test it and see what happens. For example:

  • Create a new stage
  • Create a Maya sphere
  • Duplicate the Maya sphere to the stage
  • Delete the Maya sphere
  • Edit-as-Maya the USD sphere
  • Move the sphere and enlarge it
  • Merge to USD
  • Print the root layer to the script log

What happens to the sphere definition in the root layer?

@pierrebai-adsk
Copy link
Collaborator

Oh, I just realized that the function will only create the over if the prim does not exist already. Forget it, your solution works.

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

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

LGTM, I thought the fix would be much more complicated. Good thing it was assigned to you! I'm afraid I would have gone down the wrong path.

@pierrebai-adsk
Copy link
Collaborator

I do have a follow-up question: since the data in the temporary layer is defined as "def", don't we lose the "over" in the destination layer, getting over-written by the "def" during the merge? I think I'd like to have a unit-test to verify it.

@pierrebai-adsk pierrebai-adsk self-requested a review June 19, 2023 17:43
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

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

Please add a unit test that merges into an empty, higher layer.
Something like:

  • Create two layers
  • Target the lower layer (least priority)
  • Create a prim
  • Target higer layer
  • Edit as maya
  • Move the prim as a Maya object
  • Merge to USD
  • Verify the lower layer in unchanged
  • Verify that the higher layer has a "over"

There are multiple examples of something similar in testMergeToUsd.py

@vlasovi
Copy link
Collaborator Author

vlasovi commented Jun 19, 2023

Yeah, you are right. It would be good to have this unit test.

@vlasovi vlasovi added the ready-for-merge Development process is finished, PR is ready for merge label Jun 20, 2023
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Jun 20, 2023
@seando-adsk seando-adsk merged commit bcefeb0 into dev Jun 20, 2023
@seando-adsk seando-adsk deleted the vlasovi/EMSUSD-85 branch June 20, 2023 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