-
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-127045 Add reparenting rules for Shaders, NodeGraphs and Materials. #2811
Conversation
…ph and UsdShadeMaterial. Users are able to reparent USD items in the Outliner. However, in some cases, reparenting does not make sense and can lead to problematic situations in LookdevX. The following rules are established, when a user tries to reparent items in the Outliner: - UsdShadeShader can only have UsdShadeNodeGraph/UsdShadeMaterial as parent. - UsdShadeNodeGraph can only have a UsdShadeNodeGraph/UsdShadeMaterial as parent. - UsdShadeMaterial can not have UsdShadeShader/UsdShadeNodeGraph/UsdShadeMaterial as parent. If one of the rules is broken, reparenting is prevented.
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.
This requires a unit test, similar to this one that tests the existing gprim restriction:
https://github.com/Autodesk/maya-usd/blob/dev/test/lib/ufe/testParentCmd.py#L1045
…rials. - Add tests for the new reparenting rules of UsdShadeShader, UsdShadeNodeGraph and UsdShadeMaterial. - Adjust the `testUnparentMultiStage` test to not break the new reparenting rules.
…erials for Maya2023 and later. In Maya 2022, reparenting something to a Material results in: ``` RuntimeError: Object [path/to/material] does not support parenting and therefore cannot be a parent. ```
@seando-adsk I changed one of the existing tests that was unparenting a Shader, which is no longer allowed. I also added tests for the new reparenting rules. I made the new tests only run for Maya2023 and later, because reparenting something to a Material in Maya2022 results in a runtime error for some reason:
If you approve of my changes, the PR is ready for merge. |
MAYA-127045 Add reparenting rules for UsdShadeShader, UsdShadeNodeGraph and UsdShadeMaterial.
Users are able to reparent USD items in the Outliner. However, in some cases, reparenting does not make sense and can lead to problematic situations in LookdevX. The following rules are established, when a user tries to reparent items in the Outliner:
If one of the rules is broken, reparenting is prevented.