-
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-106477 selection and point snapping support for mtoh #776
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8e107d8
MAYA-106477 selection and point snapping support for mtoh
9afde83
MAYA-106477 remove a debugging printf
43b6f8f
fix build errors
e031614
MAYA-106477 Reduce mutex locking frequency
12ee864
MAYA-106477 fix selection highlight in moth for instanced prims
edff755
Conditional compilation on the point snapping collection
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,15 @@ class MtohRenderOverride : public MHWRender::MRenderOverride { | |
MHWRender::MRenderOperation* renderOperation() override; | ||
bool nextRenderOperation() override; | ||
|
||
#if MAYA_API_VERSION >= 20210000 | ||
bool select( | ||
const MHWRender::MFrameContext& frameContext, | ||
const MHWRender::MSelectionInfo& selectInfo, | ||
bool useDepth, | ||
MSelectionList& selectionList, | ||
MPointArray& worldSpaceHitPts) override; | ||
#endif | ||
|
||
private: | ||
typedef std::pair<MString, MCallbackIdArray> PanelCallbacks; | ||
typedef std::vector<PanelCallbacks> PanelCallbacksList; | ||
|
@@ -175,6 +184,11 @@ class MtohRenderOverride : public MHWRender::MRenderOverride { | |
HdRprimCollection _selectionCollection{ | ||
HdReprTokens->wire, HdReprSelector(HdReprTokens->wire) | ||
}; | ||
HdRprimCollection _pointSnappingCollection{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth also hiding this one behind a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. |
||
HdTokens->geometry, | ||
HdReprSelector(HdReprTokens->refined, TfToken(), HdReprTokens->points), | ||
SdfPath::AbsoluteRootPath() | ||
}; | ||
GlfSimpleLight _defaultLight; | ||
|
||
std::vector<HdMayaDelegatePtr> _delegates; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we probably want to vary this depending on what
selectInfo.singleSelection
andselectInfo.selectClosest
return.resolveUnique
makes sense for a marquee-selection scenario (within the limits under discussion here), but probably doesn't for single select.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.
Maybe, but I haven't seen issue for single selection when testing the code. With the code merged, I am sure there are still some improvements in the plugin side as we iterate over time. So maybe something for future?
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.
Well, like I said, this falls more under the class of an optimization. It's a pretty easy check to make, and you'd then be able to skip the
ResolveUniqueHits_Workaround
if you were doingresolveNearestToCenter
orresolveNearestToCamera
... but you're likely also right, in that it may not be noticeable for single select, since the pick region is generally going to be pretty small. So your call.