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

Update AL_USDMaya Selection code to work with UFE Selection #1855

Closed
wants to merge 4 commits into from

Conversation

jonjondev
Copy link
Contributor

This PR implements various changes additionally supporting UFE selection across the AL plugin.

Copy link
Collaborator

@ppt-adsk ppt-adsk left a comment

Choose a reason for hiding this comment

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

My lack of familiarity with the AL plugin most certainly means that some of the comments are off-base, but I'm perplexed by the change to the proxyShapeBase code to provide UFE selection observability. Given that the UFE global selection is already observable, this might suggest that we are missing something to make the UFE global selection observation as useful as possible to its clients.

if (index != std::string::npos) {
m_proxy->m_selectedPaths.insert(SdfPath(pathStr.c_str() + index));
} else {
// Presumably the root node has been selected, but it doesn't appear I
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typically we use the proxy shape node itself as a proxy for the USD root, e.g. in the UFE hierarchy interface the proxy shape children are in fact the USD root children.

MGlobal::getActiveSelectionList(sl);
sl.add(m_proxy->thisMObject());

// UGH. This nukes the UFE selection, and it doesn't appear it's possible to create a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hopefully using the proxy shape node will be useful here.

}

/// UGH! This clears the UFE selection :(
MGlobal::setActiveSelectionList(sl);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The UFE selection should be a superset of the the Maya selection, as far as objects are concerned. Therefore, following this call, the UFE selection should have all the Maya objects in sl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this in response to the comment?

for (auto& selectedPath : orderedPaths) {
// when selecting the root path, select the ProxyShape node using normal maya
// selection
if (selectedPath == root) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This difference between using the Maya selection and the UFE selection to deal with the pseudo-root feels tricky. Why not just add the proxy shape to the UFE selection? I'm far from being an expert in the AL plugin, so ignore this suggestion if it's not relevant.

@@ -1108,6 +1108,9 @@ bool ProxyRenderDelegate::getInstancedSelectionPath(
return false;
}

if (_proxyShapeData->ProxyShape())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this going to catch only marquee selections in the viewport? What about selections made in the Outliner, or any other future UFE-enabled node viewer or editor? How would they receive these pre selection and post selection changed notifications? Is there no way to reformulate this as standard UFE selection changed notifications? It feels awkward to go through the proxy shape to distribute the notifications, when the UFE global selection itself is already observable, and is not tied to viewport-based selection.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're looking into removing (or at least moving somewhere else) these notifications.

@fabal
Copy link
Contributor

fabal commented Nov 30, 2021

Thanks for the review @ppt-adsk , we'll get back to you shortly.

@fabal
Copy link
Contributor

fabal commented Dec 1, 2021

The code found in ProxyShapeSelection.cpp (and corresponding tests) is not supported anymore internally (at Animal Logic) which means that the changes you see in there are rather old (we still need to merge them though).
To ease the review for our next PRs, we can highlight the code which doesn't need a review so you can save some time.

@jonjondev
Copy link
Contributor Author

Thanks for the feedback @ppt-adsk, after some discussions within the team we're potentially looking to retire code related to proxy draw override and proxy shape selection as per discussion topic #1879. I'll close the PR now, given that it's almost entirely about those two. Again, thank you for the suggestions, it's helped move things along quite a bit!

@jonjondev jonjondev closed this Dec 6, 2021
@jonjondev jonjondev deleted the J-Mo63/al-ufe-selection branch December 6, 2021 21:52
@ppt-adsk
Copy link
Collaborator

ppt-adsk commented Dec 6, 2021

Excellent, glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants