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

MAYA-125867 fix edit-as-Maya on fresh Maya session #2670

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

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.

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.
@pierrebai-adsk pierrebai-adsk added bug Something isn't working adsk Related to Autodesk plugin labels Oct 21, 2022
Comment on lines -131 to -133
// 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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

@pierrebai-adsk pierrebai-adsk Oct 24, 2022

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 25, 2022
@seando-adsk seando-adsk merged commit 83a6e08 into dev Oct 25, 2022
@seando-adsk seando-adsk deleted the bailp/MAYA-125867/edit-as-maya-vs-restart branch October 25, 2022 22:30
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 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