-
Notifications
You must be signed in to change notification settings - Fork 203
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-125867 fix edit-as-Maya on fresh Maya session #2670
Conversation
When a USD object is edited as Maya and the Maya scene is saved, if Maya is restarted and teh scene reloaded, the edited USD object cannot be manipulated again. That was due to internal non-saved state not being set properly when restarting Maya. Avoid the problem by not using non-persistent state.
// Becomes true when there is at least one pulled prim. | ||
// The goal is to let code that can be optimized when there is no pull prim | ||
// to check rapidly. |
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.
What about this optimization? Now you are using findPullRoot() which searches thru the entire dag hierarchy looking for one.
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.
It does not search the entire DAG.
Only the direct children of the root are iterated. Note that we do that find operation whenever we actually edit-as-Maya or any other edit-related op, so it surely is not slow.
If we do find it became a bottleneck, we can even optimize it further by using a MSelection with the pull-set name, which would be even faster.
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.
I changed findPullRoot() to use MSelectionList, so now there is no iteration at all, just direct access to the object, so there should be no performance risk. Bonus: the code is also faster for the actual operations.
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 that is much better.
When a USD object is edited as Maya and the Maya scene is saved, if Maya is restarted and teh scene reloaded, the edited USD object cannot be manipulated again. That was due to internal non-saved state not being set properly when restarting Maya.
Avoid the problem by not using non-persistent state.