-
Notifications
You must be signed in to change notification settings - Fork 201
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-106075 - USD selection highlighting doesn't take Color Settings into consideration #2033
Conversation
: drawScene.GetWireframeColor()); | ||
= (_selectionStatus != kUnselected ? drawScene.GetSelectionHighlightColor( | ||
_selectionStatus == kFullyLead ? nullptr : "curve") | ||
: drawScene.GetWireframeColor()); |
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.
Should this little bit of logic deciding which color to use based on the selection status move into a common location? I'm not sure if it makes sense on drawScene, maybe if we do a shared parentClass for rprims this logic could live there.
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.
Yes, I think I will address that as part of my future work on points.
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 think a lot of the testVP2RenderDelegate* tests will fail because the image diffs will pick up the different color of the selection.
{ | ||
MDoubleArray colorResult; | ||
std::lock_guard<std::mutex> _(_mayaCommandEngineMutex); | ||
MGlobal::executeCommand(queryCommand, colorResult); |
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.
If a caller passes in a className which isn't valid do we get some kind of error we can warn about?
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.
executeCommand runs with displayEnabled = false, so I guess it will not write any error info into log. I think it would be good to set displayEnabled to true here
// Query and return the selection color. | ||
{ | ||
MDoubleArray colorResult; | ||
std::lock_guard<std::mutex> _(_mayaCommandEngineMutex); |
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.
Can we rename the std::lock_guard local variable to something meaningful? I can guess at your thinking that nobody should be doing anything to it after it is created because of the RAII nature of the object so the name doesn't matter, but I don't like the style of naming it underscore. It just looks strange to me and then I spent some time thinking about it.
- Applying minor improvements after the code review
…hlight colors (for Maya 2022 and below) match the properly calculated colors in autotests
- Some refactoring
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.
Looks great!
@vlasovi I run the PF and there is still one error to fix:
|
@kxl-adsk This error is due to the fact that our preflight is using an old version of Maya Preview Release that doesn't have the API I use. The issue should be fixed by the preflight updated that @seando-adsk has in review now: https://git.autodesk.com/media-and-entertainment/ecg-maya-usd/pull/191 |
Get up-to-date selection color settings from Maya. This includes 'lead' color as well as curve and surface active colors.