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-1017 Fix reverting multiple files #3625

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

pierrebai-adsk
Copy link
Collaborator

When reverting multiple USD layers, reverting the first layer would trigger the UI to update, thus making the the element holding the other layers invalid before they were processed.

To avoid this, add a mechanism to delay the execution of commands in the command-hook so that all item can be processed before the first command is executed.

In the Maya implementation of the command hook, the MEL and Python commands are accumulated when the commands are delayed and executed once the delayed commands are triggered.

@pierrebai-adsk pierrebai-adsk added bug Something isn't working adsk Related to Autodesk plugin crash labels Feb 19, 2024
@pierrebai-adsk pierrebai-adsk self-assigned this Feb 19, 2024
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1017/fix-multi-revert-crash branch from cbd8e12 to 96feace Compare February 19, 2024 20:55
When reverting multiple USD layers, reverting the first layer would trigger the UI to update, thus making the the element holding the other layers invalid before they were processed.

To avoid this, add a mechanism to delay the execution of commands in the command-hook so that all item can be processed before the first command is executed.

In the Maya implementation of the command hook, the MEL and Python commands are accumulated when the commands are delayed and executed once the delayed commands are triggered.
@pierrebai-adsk pierrebai-adsk force-pushed the bailp/EMSUSD-1017/fix-multi-revert-crash branch from 96feace to 31620d7 Compare February 19, 2024 21:38
}
}

void MayaCommandHook::executeDelayedCommands()
Copy link
Collaborator

@AramAzhari-adsk AramAzhari-adsk Feb 20, 2024

Choose a reason for hiding this comment

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

Would you mind adding a comment that this function should not be called directly?

MGlobal::executeCommand(
MString(commandString.c_str()),
result,
/*display*/ true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we always want to have display on?

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 like that in the existing code that I moved here from the top of the file.

Copy link
Collaborator

@AramAzhari-adsk AramAzhari-adsk left a comment

Choose a reason for hiding this comment

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

LGTM

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 22, 2024
@seando-adsk seando-adsk merged commit f8c1d93 into dev Feb 22, 2024
11 checks passed
@seando-adsk seando-adsk deleted the bailp/EMSUSD-1017/fix-multi-revert-crash branch February 22, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin bug Something isn't working crash ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants