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-106032 - add new prim fails after delete #742

Merged

Conversation

seando-adsk
Copy link
Collaborator

MAYA-106032 - Adding a prim and then deleting it no longer allows the addition of prims of the same type

  • When computing unique child name we need to also consider inactive prims.

… addition of prims of the same type

* When computing unique child name we need to also consider
  inactive prims.
Comment on lines +300 to +303
# Add a new Xform prim.
cmd = contextOps.doOpCmd(['Add New Prim', 'Xform'])
self.assertIsNotNone(cmd)
ufeCmd.execute(cmd)
Copy link
Collaborator Author

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

Comment on lines +310 to +313
# Using UFE, delete this new prim (which doesn't actually delete it but
# instead makes it inactive).
cmds.pickWalk(d='down')
cmds.delete()
Copy link
Collaborator Author

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)

Comment on lines +319 to +323
# 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)
Copy link
Collaborator Author

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

Comment on lines +325 to +327
# The proxy shape should now have a single UFE child item.
self.assertTrue(proxyShapehier.hasChildren())
self.assertEqual(len(proxyShapehier.children()), 1)
Copy link
Collaborator Author

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)

@seando-adsk seando-adsk requested a review from ppt-adsk August 25, 2020 15:36
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great comment, thanks.

@seando-adsk seando-adsk added bug Something isn't working ufe-usd Related to UFE-USD plugin in Maya-Usd labels Aug 25, 2020
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Aug 26, 2020
@kxl-adsk kxl-adsk merged commit 0263746 into dev Aug 26, 2020
@kxl-adsk kxl-adsk deleted the donnels/MAYA-106032/adding_new_prim_fails_after_delete branch August 26, 2020 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants