-
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-111835: Fix grouping a prim twice that crashed Maya. #1453
Conversation
# Group object (a.k.a parent) will be added to selection list. This behavior matches the native Maya group command. | ||
globalSelection = ufe.GlobalSelection.get() | ||
|
||
groupPath = ufe.Path([mayaPathSegment, usdUtils.createUfePathSegment("/Ball_set/Props/newGroup1")]) | ||
self.assertEqual(globalSelection.front(), ufe.Hierarchy.createItem(groupPath)) | ||
|
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.
test driven development ( TDD ). Wrote the test first, it failed. Added new code logic and pass.
auto noWorld = _group->path().popHead(); | ||
auto fullPath = noWorld.getSegments().front().string() + Ufe::PathString::pathSegmentSeparator() | ||
+ noWorld.getSegments().back().string(); | ||
|
||
MString groupPath(fullPath.c_str()); | ||
MGlobal::executeCommand(MString("select -r \"") + groupPath + "\" "); | ||
|
||
TF_VERIFY( | ||
Ufe::GlobalSelection::get()->size() == 1, | ||
"_group node should be in the global selection now. \n"); |
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 previously had nothing selected after group was created. This resulted in crash in UsdUndoInsertChildCommand if one tries to call the group the second time without having something selected.
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.
I am setting this PR as ready to merge. I do not believe the random test failures have anything to do with my changes. They look like permission issue:
16/153 Test #7: testMayaUsdProxyAccessor ........................***Failed 34.06 sec
|
@HamedSabri-adsk please report this to our DevOps team using the usual process. |
Fixes #1418 |
This PR fixes the grouping crash and also makes sure that the group node ( a.k.a parent ) is selected which should match Maya's native behavior.
2021-06-02.10-25-00.mp4