MAYA-122927 interaction between deactivation and cancel edit #2794
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.
When a Maya reference is edited, its USD prim is deactivated to hide it in the outliner. If its parent prim is then deactivated, the edit is orphaned. At that point the Maya Ref prim and its parent are both deactivated. If the edit is cancelled while the parent is deactivated, the code could not activate the Maya Ref USD prim because children of deactivated prims cannot be modified. We needed to fix this.
The fix is to add code to temporarily reactivate ancestors prims when trying to activate a prim. The design actually provides a class to temporarily activate all ancestors of a prim, for any possible edits.
A unit test already checked the case where an edited prim was under a dectivated prim, but had not checked for the proper result due to the known bug. Simply fix the test for the fix.
Also, fix that the auto-edit flag was not being properly updated due to the same ancestor-is-deactivated problem.