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-114711 As a user, when clicking on 'Edit as Maya Data' I'd like … #1896

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

boudrey
Copy link
Contributor

@boudrey boudrey commented Dec 9, 2021

…to get an edit on my sessionLayer instead of my editTarget layer

…to get an edit on my sessionLayer instead of my editTarget layer
auto stage = prim.GetStage();
if (!stage)
return false;
UsdEditContext editContext(stage, stage->GetSessionLayer());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think this is necessary, since we're only reading, not writing. The composed state of the prim should include the session layer, and therefore the read should succeed.

self.assertFalse(stage.GetSessionLayer().empty)

kPullPrimMetadataKey = "Maya:Pull:DagPath"
with Usd.EditContext(stage, stage.GetSessionLayer()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think this line is needed, since you're only reading.

# Now Session Layer should be empty, but it is not, it has an empty content
self.assertFalse(stage.GetSessionLayer().empty)

with Usd.EditContext(stage, stage.GetSessionLayer()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, this line shouldn't be needed.

self.assertTrue(mayaUsd.lib.PrimUpdaterManager.discardEdits("A"))

# Now Session Layer should be empty, but it is not, it has an empty content
self.assertFalse(stage.GetSessionLayer().empty)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this empty content?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// USD Layer identifier: anon:00000217FCAC6AE0:anonymousLayer1-session.usda
// Real Path:
// #usda 1.0
//
// over "A"
// {
// }
//

Copy link
Collaborator

Choose a reason for hiding this comment

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

O.K., this is what I suspected. We should be doing this:
https://graphics.pixar.com/usd/release/api/class_sdf_layer.html#a55468b05043d021961a36fdf4912863d
to remove the inert primSpec. I feel this is out of scope for your pull request, so I'll enter a separate JIRA ticket for it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Entered as MAYA-120677.

@boudrey boudrey added the ready-for-merge Development process is finished, PR is ready for merge label Dec 9, 2021
@seando-adsk seando-adsk merged commit b31a6c9 into dev Dec 16, 2021
@seando-adsk seando-adsk deleted the boudrey/MAYA-114711/EditAsMayaInSessionLayer branch December 16, 2021 21:52
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants