-
Notifications
You must be signed in to change notification settings - Fork 202
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-128513 implement code wrapper handler #3102
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pierrebai-adsk
commented
May 17, 2023
Implement a code wrapper handler to support edit routing for composite commands: - Make the batch-ops handler derive from the correct class depending on which feature is supported in UFE. - Implement a code wrapper handler derived from the batch ops handler. - This code wrapper handler creates edit-routing wrappers for composite commands. Implement a code wrapper that does the edit routing: - The code wrapper cache the stage and layer used when first executing a composite command. - This allows using the same values when undoing. - This is necessary because the original prim that was used when executing the command might not exist anymore once the command executed. - In particular, this is true for the group command, the original prim no longer exists. Make the group command work with edit routing. Note that the Maya group command is implemented in term of the insert-child UFE command. That is why we are modifying the insert-child command. - Use the generic undo/redo support to record the changes, undo and redo them. - Don't assume that the current edit target is where the source prim has opinion. - Instead, apply the child-insertion to the layer that have opinion about the moving prim. - The command restrictions already ensure that we only affect prims that have a single opinion. - (But with these changes, the code will be ready if we support multi-layers command later on.) - The problem was that the command restrictions were correctly looking at where the prim was authored, but the command execution was assuming that the source opinion was on the target layer. - When routing commands, that can obviously be false: the target might not be where the original opinions were. - We do the right thing using similar code as when affecting the session layer, except the target layer is the layer where the command was routed. - By default, when no routing is registered, that is the current edit target. - Fix load rules duplication: the Load rules are not part of the USD data that gets restore by automatic USD undo block, so we need to duplicate them explicitly. Also, the UFE reparent notification need to be triggered during undo and redo. Fix unit tests: - The unit tests were tied to some subtle behavior of the implementation. Now that we use "perfect" undo/redo, the order of items is also preserved, so the testGroupCmd assertions had to be fixed. Similarly, the parent command was assuming the parent prim was passed to the edit router. It was also creating the parent prims, which is not necessary. (The problem was fixed before, but the fix was hidden due to the exact timing of the edit routing call.) - Also made the parent unit test for edit routing properly unregister the router even when the test fails. Otherwise, the subsequent test crashes due to the invalid edit router being left behind. - Added a unit test for the Maya group composite command. - Made sure the code wrapper unit test is not run when the API is not available. - Made text filtering ignore all white spaces at the start and end of lines to avoid to have to write the exact indentations.
a183bf5
to
e03935a
Compare
AramAzhari-adsk
previously approved these changes
May 29, 2023
seando-adsk
requested changes
May 30, 2023
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.
Overall the changes look good. Great work. Just a few minor things to fix.
- Fix some incorrect ifdef in Global.cpp. They were currently harmless because all UFE V4 if were always satisfied simultaneously, but the code was still not theoretically correct. - Fix some useUfe vs mayaUSD include issues. - Move an anonymous namespace. - Remove a debug print in a test.
AramAzhari-adsk
previously approved these changes
May 30, 2023
seando-adsk
reviewed
May 30, 2023
- Return the stage pointer by value. - Remove old UFE version check.
seando-adsk
approved these changes
May 31, 2023
AramAzhari-adsk
approved these changes
May 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
adsk
Related to Autodesk plugin
enhancement
New feature or request
ready-for-merge
Development process is finished, PR is ready for merge
ufe
Related to UFE component in Maya
ufe-usd
Related to UFE-USD plugin in Maya-Usd
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement a code wrapper handler to support edit routing for composite commands:
Implement a code wrapper that does the edit routing:
Make the group command work with edit routing. Note that the Maya group command is implemented in term of the insert-child UFE command. That is why we are modifying the insert-child command.
Fix unit tests: