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-121877 cancel edit on maya ref under an xform #2186

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

When a Maya ref is under a xofrm and that xform is edited-as-maya, show the proper menu for the maya ref and handle the cancel-edit correctly.

  • Detect the Maya ref for the context menu using the USD_typeName.
  • Refactor the code that use the USD_typeName attribute in the prim update manager.
  • Use the new common code in merge-to-USD, edit-as-Maya, discard edits and orphaned edits.

When a Maya ref is under a xofrm and that xform is edited-as-maya, show the proper menu for the maya ref and handle the cancel-edit correctly.

- Detect the Maya ref for the context menu using the USD_typeName.
- Refactor the code that use the USD_typeName attribute in the prim update manager.
- Use the new common code in merge-to-USD, edit-as-Maya, discard edits and orphaned edits.
@@ -415,10 +415,45 @@ PullImportPaths pullImport(
return PullImportPaths(addedDagPaths, pulledUfePaths);
}

//------------------------------------------------------------------------------
//
UsdMayaPrimUpdaterRegistry::RegisterItem getUpdaterItem(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is refactored code taken from pullCustomize so that discardEdits and others can use teh same logic to decide which prim updater to use.

@pierrebai-adsk pierrebai-adsk requested a review from ppt-adsk March 15, 2022 15:30
return UsdMayaPrimUpdaterRegistry::FindOrFallback(
TfToken(usdTypeNamePlug.asString().asChar()));

// The root of the pulled hierarchy is crucial for determining push
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this? This would be masking the lack of USD_typeName information in the pulled Maya data. I think it's adding complexity to the design and making it harder to understand. I get that it makes it more "robust", but I would argue that we are compensating for incorrect use of the framework.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was just moving the existing code that already did this. It was taken from discardEdits. It could still be useful if an edit-as-maya aborted mid-way through before setting the USD_typeName or it the user or Maya edition somehow removed the attribute?

Otherwose, I don't mind removing this fallback.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it's worth the extra complexity, let's get rid of it.

//------------------------------------------------------------------------------
//
// Perform the customization step of the pull (second step).
bool pullCustomize(const PullImportPaths& importedPaths, const UsdMayaPrimUpdaterContext& context)
bool pullCustomize(
const Ufe::Path& initialPulledPath,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we get rid of the initial pulled path in getUpdaterItem() you wouldn't need to change this interface.

Don't try to patch-up problems, use the design.
@pierrebai-adsk pierrebai-adsk requested a review from ppt-adsk March 15, 2022 17:30
ppt-adsk
ppt-adsk previously approved these changes Mar 15, 2022
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 15, 2022
@ppt-adsk ppt-adsk added core Related to core library workflows Related to in-context workflows and removed ready-for-merge Development process is finished, PR is ready for merge labels Mar 15, 2022
@ppt-adsk ppt-adsk merged commit 627a98e into dev Mar 15, 2022
@ppt-adsk ppt-adsk deleted the t_bailp/MAYA-121877/maya-ref-under-xform-cant-cancel branch March 15, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to core library workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants