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

EMSUSD-895 - Payload command undo to restore payload rules #3714

Conversation

brossee-adsk
Copy link
Collaborator

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.

@AntonK-Adsk AntonK-Adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Apr 11, 2024
@brossee-adsk brossee-adsk self-assigned this Apr 12, 2024
// 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) \
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@seando-adsk seando-adsk requested review from pierrebai-adsk and removed request for seando-adsk April 15, 2024 13:36
pierrebai-adsk
pierrebai-adsk previously approved these changes Apr 15, 2024
AntonK-Adsk
AntonK-Adsk previously approved these changes Apr 15, 2024
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk left a comment

Choose a reason for hiding this comment

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

Great, LGTM

Copy link
Collaborator

@deboisj deboisj left a comment

Choose a reason for hiding this comment

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

👍

@brossee-adsk brossee-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 19, 2024
@seando-adsk seando-adsk removed the ready-for-merge Development process is finished, PR is ready for merge label Apr 23, 2024
@seando-adsk
Copy link
Collaborator

@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 ready-for-merge label. Once the preflight is successful, please add the label back then someone will merge your PR.

@brossee-adsk brossee-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 23, 2024
@seando-adsk seando-adsk merged commit 1e93946 into Autodesk:dev Apr 23, 2024
15 checks passed
@brossee-adsk brossee-adsk deleted the brossee/EMSUSD-895/payload-undo-to-previous-rules branch April 23, 2024 17:49
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 ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants