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-111835: Fix grouping a prim twice that crashed Maya. #1453

Merged
merged 3 commits into from
Jun 2, 2021

Conversation

HamedSabri-adsk
Copy link
Contributor

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

@HamedSabri-adsk HamedSabri-adsk added core Related to core library workflows Related to in-context workflows labels Jun 2, 2021
@HamedSabri-adsk HamedSabri-adsk requested a review from ppt-adsk June 2, 2021 17:19
Comment on lines +112 to +117
# 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))

Copy link
Contributor Author

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.

Comment on lines 95 to 104
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");
Copy link
Contributor Author

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.

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 Thinking more about this... Made the logic even simpler:

37e51f1

@HamedSabri-adsk
Copy link
Contributor Author

@kxl-adsk

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:

https://ecg-jenkins.ecs.ads.autodesk.com/job/ecg-mayausd-branch-preflight-2019-no-ufe-windows/102/console

WindowsError: [Error 32] The process cannot access the file because it is being used by another process:

https://ecg-jenkins.ecs.ads.autodesk.com/job/ecg-mayausd-branch-preflight-2022-python3-linux/519/console

16/153 Test #7: testMayaUsdProxyAccessor ........................***Failed 34.06 sec

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/var/tmp/runtime-administrator'

@HamedSabri-adsk HamedSabri-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 2, 2021
@kxl-adsk
Copy link

kxl-adsk commented Jun 2, 2021

@HamedSabri-adsk please report this to our DevOps team using the usual process.

@kxl-adsk kxl-adsk merged commit f3b37cf into dev Jun 2, 2021
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-111835/fix_crash_grouping_twice branch June 2, 2021 22:07
@kxl-adsk
Copy link

kxl-adsk commented Jun 3, 2021

Fixes #1418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to core library ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants