-
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
T bailp/maya 115146/maya ref naming 2 #2350
Conversation
Based on Yves Boudreault's branch. Simplified it a bit after merging - Add an environment variable MAYAUSD_ENABLE_MAYA_REFERENCE_OLD_BEHAVIOUR to use the old behaviour in AL. - Keeps the Maya Ref node name in a custom attribute. - Requires that the attribute be directly on the prim, not in a lower layer or indirect reference. - This allows having a different Maya Ref Node for each prim even if they are built from teh same substrate. - Adds more unit tests.
Improve the code to avoid having two Maya Ref that happen to refer to the same reference file use each other's Maya Ref Node by accident. The subtle change is that we no longer search for the corresponding Maya Ref Node if the custom attribute is not present. When the attribute is not present, it means the Maya Ref was never edited and thus need to create its own Maya Ref Node, not search for an existing one. I also refactored the code to avoid some code duplication and push out some code into their own functions for clarity. - Make all ref-node-name generator always generate the full name, including any RN suffix. - Renamed isMayaReference() to useNewMayaRefNaming() for clarity since that was the function's purpose. - Added setMayaRefCustomAttribute() and getMayaRefCustomAttribute() for clarity, isolation and reuse. - Got rid of getRefNodeNameFromPrim() since its only usage was to try to find a Maya Ref Node when the custom attribute was absent, which was incorrect and led to accidentally use the node from other Maya Ref. - De-duplicate the Maya ref node searching code. - Fixed the new test that simulated reparent a prim but did not simulate that the custom attribute would follow.
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.
Nit-picks only, thanks for doing this!
Looking for some feedback on how this will affect the AL plugin. Would changing the naming scheme by default be a problem? |
Use legacy-oriented function and env, var names instead of new-oriented names to emphasize that it is code that might be removed in the future.
... use the length function instead.
Given that this is pretty much equivalent to what Yves had written and it was approved, I'm going to label this as ready for merge. |
Based on Yves Boudreault's branch.
Simplified it a bit after merging, fixed issues with reconnecting to the wrong node.
From Yves's original code I kept:
Improve the code to avoid having two Maya Ref that happen to refer to the same reference file use each other's Maya Ref Node by accident.
The subtle change is that we no longer search for the corresponding Maya Ref Node if the custom attribute is not present. When the attribute is not present, it means the Maya Ref was never edited and thus need to create its own Maya Ref Node, not search for an existing one.
I also refactored the code to avoid some code duplication and push out some code into their own functions for clarity.