-
Notifications
You must be signed in to change notification settings - Fork 201
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
EMSUSD-895 - Payload command undo to restore payload rules #3714
EMSUSD-895 - Payload command undo to restore payload rules #3714
Conversation
// Macros to handle the redo/undo actions on stage load/unload rules | ||
// The load rules are saved before applying new rules and are | ||
// applied back when the commands are undo | ||
#define STAGE_PAYLOAD_ACTION(action) \ |
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.
Could use a function instead of a macro - with a lambda you can do the same thing. Personnally I find macros annoying to maintain and work with.
const PXR_NS::UsdStageWeakPtr _stage; | ||
const PXR_NS::SdfPath _primPath; | ||
PXR_NS::UsdLoadPolicy _policy; | ||
PXR_NS::UsdStageLoadRules _undoRules; |
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.
You probably want to update / add to https://git.autodesk.com/maya3d/maya-usd/blob/dev/test/lib/ufe/testPayloadCommands.py
1ed41ab
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.
Great, LGTM
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.
👍
@brossee-adsk I didn't see a preflight build. I think it might be because you assigned the PR to me which remove the check. So I unassigned your PR and then just assigned it to you. I see the preflight started. I removed the |
Payload undo doesn't go back to previous descendants states. The fix keeps the state of the payload rules applied on the stage before executing the command to load/unload a payload. The kept state is reapplied on the stage when the undo command is requested.