-
Notifications
You must be signed in to change notification settings - Fork 203
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
Conversation
Turn off auto-edit when ref edit are discarded.
There was a problem hiding this 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?
lib/mayaUsd/CMakeLists.txt
Outdated
@@ -200,6 +200,7 @@ target_link_libraries(${PROJECT_NAME} | |||
$<$<BOOL:${UFE_FOUND}>:${UFE_LIBRARY}> | |||
${MAYA_LIBRARIES} | |||
mayaUsdUtils | |||
mayaUsd_Schemas |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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> |
There was a problem hiding this comment.
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.
Turn off auto-edit when ref edit are discarded.