-
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-106032 - add new prim fails after delete #742
MAYA-106032 - add new prim fails after delete #742
Conversation
… addition of prims of the same type * When computing unique child name we need to also consider inactive prims.
# Add a new Xform prim. | ||
cmd = contextOps.doOpCmd(['Add New Prim', 'Xform']) | ||
self.assertIsNotNone(cmd) | ||
ufeCmd.execute(cmd) |
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.
Create a single xform prim
# Using UFE, delete this new prim (which doesn't actually delete it but | ||
# instead makes it inactive). | ||
cmds.pickWalk(d='down') | ||
cmds.delete() |
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.
Delete that new xform (which will deactivate it)
# Add another Xform prim (which should get a unique name taking into | ||
# account the prim we just made inactive). | ||
cmd = contextOps.doOpCmd(['Add New Prim', 'Xform']) | ||
self.assertIsNotNone(cmd) | ||
ufeCmd.execute(cmd) |
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.
Create another xform prim - it should succeed with a unique name that considered the inactive prim
# The proxy shape should now have a single UFE child item. | ||
self.assertTrue(proxyShapehier.hasChildren()) | ||
self.assertEqual(len(proxyShapehier.children()), 1) |
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.
We should have one child (because we don't count the inactive one)
@@ -135,7 +135,19 @@ std::string uniqueChildName(const UsdSceneItem::Ptr& usdParent, const Ufe::Path& | |||
if (!usdParent) return std::string(); | |||
|
|||
TfToken::HashSet childrenNames; | |||
for (auto child : usdParent->prim().GetChildren()) | |||
|
|||
// The prim GetChildren method used the UsdPrimDefaultPredicate which includes |
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 comment, thanks.
MAYA-106032 - Adding a prim and then deleting it no longer allows the addition of prims of the same type