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-122131 Maya Ref Auto-Edit Handling #2235

Merged
merged 4 commits into from
Apr 22, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

Turn off auto-edit when ref edit are discarded.

Turn off auto-edit when ref edit are discarded.
Copy link
Collaborator

@ppt-adsk ppt-adsk left a comment

Choose a reason for hiding this comment

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

Any way we can test this automatically?

@@ -200,6 +200,7 @@ target_link_libraries(${PROJECT_NAME}
$<$<BOOL:${UFE_FOUND}>:${UFE_LIBRARY}>
${MAYA_LIBRARIES}
mayaUsdUtils
mayaUsd_Schemas
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 we should be adding this dependence.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was necessary to access the schema attribute.

@@ -1022,6 +1023,15 @@ bool PrimUpdaterManager::discardPrimEdits(const Ufe::Path& pulledPath)
updater->discardEdits();
}

// Reset the auto-edit when discarding the edit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Essentially, we are checking for a particular node type here --- and I don't think that's a good idea. I would really hope we can implement an override of the discardEdits() virtual on MayaReferenceUpdater and do the work there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't have access to the information in discardEdits. We don't have the USD prim nor the path to the USD prim. When we discard edit, because obviously we're nor exporting, we don't have the maya node <-> USD prim map that gets generated when doing a merge-to-USD.

I had tried initially to put this code in the discardEdits of the Maya ref but it failed due to that.

New maya ref discard edit unit test verying the attribute is updated.
Reset the flag in the prim updater instead of the manager.
@pierrebai-adsk
Copy link
Collaborator Author

Upon further reflection, this is related to auto-edit of Maya Ref, so it is always the Maya Ref itsef that is being edited, not through a ancestor, so we should probably only turn it off when edited automatically. IOW, we don't need to worry about more complicated scenarios.

@@ -42,6 +44,7 @@
#include <pxr/usd/usdUtils/pipeline.h>

#include <maya/MFnAttribute.h>
#include <ufe/pathString.h>
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 we need this one.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 21, 2022
@seando-adsk seando-adsk added the workflows Related to in-context workflows label Apr 22, 2022
@seando-adsk seando-adsk merged commit ccece8d into dev Apr 22, 2022
@seando-adsk seando-adsk deleted the t_bailp/MAYA-122131/turn-off-auto-edit branch April 22, 2022 13:28
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