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-107087: Don't allow parenting to a Gprim. #852

Merged
merged 3 commits into from
Oct 21, 2020

Conversation

HamedSabri-adsk
Copy link
Contributor

We need to block the parenting of one gprim to another. Pixar lists this behavior as "strongly discouraged", but we are also seeing evidence that this behavior is not even fully supported through hydra.

#708 (comment)

childPrim.GetName().GetString().c_str(),
parentPrim.GetName().GetString().c_str());
throw std::runtime_error(err.c_str());
}
Copy link
Contributor Author

@HamedSabri-adsk HamedSabri-adsk Oct 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We throw an error if one tries to parent a Gprim under another.

with self.assertRaises(RuntimeError):
cmds.parent("|Tree_usd|Tree_usdShape,/TreeBase/trunk",
"|Tree_usd|Tree_usdShape,/TreeBase/leavesXform/leaves")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a unit test to back the Gprim parenting restriction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppt-adsk To make testParentRelative, testParentAbsolute working under the new rule, I created a top level Xforms for cube, cylinder, sphere in "simpleSceneTRS.usda" and made sure the Translate/Rotate/Scale and Order Ops matches the underlying meshes. Github won't show the diff results. You need to use your diff-editor locally to see the changes.

@HamedSabri-adsk HamedSabri-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows labels Oct 20, 2020
usdPaths.append(ufe.Path(
[shapeSegment, usdUtils.createUfePathSegment(n)]))
mayaPaths = []
for n in ["|world|" + o for o in names]:
for n in ["|world|" + o for o in mayaNames]:
mayaPaths.append(ufe.Path(mayaUtils.createUfePathSegment(n)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppt-adsk Adopt to the recent changes in simpleSceneTRS: Separated "maya" and "ufe" names list.

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 21, 2020
@kxl-adsk kxl-adsk merged commit c16705a into dev Oct 21, 2020
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-107087/block_parenting_gprim_to_gprim branch October 21, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants