-
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-106722 Maya check callback to see if there are any unsaved edits #934
Conversation
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.
Even if we enable this for the Autodesk plugin only, I don't see why we wouldn't put sceneResetCheck in the mayaUsd library. Please move it.
continue; | ||
} | ||
|
||
std::string temp; |
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.
This variable is unused.
SdfLayerHandleVector allLayers = stage->GetLayerStack(true); | ||
for (auto layer : allLayers) { | ||
if (layer->IsDirty()) { | ||
atLeastOneDirty = true; |
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.
Why not break here?
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.
The for loop will exit immediately, it checks atLeastOneDirty. I think I had originally been printing out some information while debugging something and just left it like this (but completely missed the temp variable you pointed out). I could remove the check in the for loop and add an extra line to "break" here if you prefer that style.
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.
Actually it won't because you are in a for-loop (allLayers) inside of that other for-loop (that checks atLeastOneDirty).
Were you thinking about adding some kind of registration where plugins would provide their proxy shape node id or something to tell the lib to look at it for dirty layers? One of the reasons I didn’t bother adding it to the common lib yet, other than just that we’re still in-progress on this, was that I believe the Animal Logic ability to save edits to the Maya scene leave the Usd layers dirty. So even though they have saved everything and can recover it, Maya will still provide this warning dialog. If this is moved down to the lib then I guess the easiest way to avoid this is the registration where we only look at proxy shapes that are requesting this check. I’m assuming that you are voting to do that and enable it for the ADSK and Pixar nodes, but not the Animal Logic node? Or were you voting to move it to the shared lib but only have it look at the ADSK nodes? |
Maybe even simpler than that. Let's move |
@fowlertADSK I believe this PR can be now closed? |
This adds a file new and open check callback so we can warn the user that they have USD edits that are not saved. The "check" callbacks from Maya pass a bool variable that you can set to false in order to block the file IO operation. Meaning, before Maya actually opens another file or creates a new scene we can cancel it and stay in the current scene.
We are still iterating on the entire workflow of warning the user and then helping them to quick save the edits, so at the moment this is only in the ADSK plugin. Once we finalize the workflow we can look at what might be useful down in the shared lib.