-
Notifications
You must be signed in to change notification settings - Fork 4
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
HYDRA-845 : Selection highlighting for point instancing of meshes #132
HYDRA-845 : Selection highlighting for point instancing of meshes #132
Conversation
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.
Not much to add that isn't already in the Markdown doc or in code comments, except for the following two questions :
- I've renamed
SceneIndexPath
toConvertUfePathToHydraSelections
, but would we prefer keeping both? Since sometimes we may not really care about the selections themselves. Note that differentUfe::Path
s could end up mapping to the sameSdfPath
s though, for example in the case of point instancer vs. instance selection, where theUfe::Path
s would differ but theSdfPath
s would both end up pointing to the instancer. - Should we rename
Fvp::PathInterface
, since it's not strictly about paths anymore? I would think how we name it also depends on if we keepSceneIndexPath
or not, and what other functionality we could end up putting in it.
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.
Fantastic work, pretty impressive how much additional complexity all this tracking requires... Minor comments from me in this pull request.
As for the path interface, I'm still uncertain as to whether it's a selection-centric class, or a path mapper class? Is there another application besides selection that we don't yet know about? In the end though, this kind of fundamental questioning is outside the scope of this pull request, so we have time to ponder this.
#if HD_API_VERSION < 66 | ||
const_cast<HdInstancerTopologySchema&>(originalInstancerTopology).GetMask()->GetTypedValue(0); | ||
#else | ||
originalInstancerTopology.GetMask()->GetTypedValue(0); | ||
#endif |
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 factor this out in an unnamed namespace function?
#if HD_API_VERSION < 66 | |
const_cast<HdInstancerTopologySchema&>(originalInstancerTopology).GetMask()->GetTypedValue(0); | |
#else | |
originalInstancerTopology.GetMask()->GetTypedValue(0); | |
#endif | |
inline HdInstancerTopologySchema& topologySchema(HdInstancerTopologySchema& t) | |
#if HD_API_VERSION < 66 | |
return const_cast<HdInstancerTopologySchema&>(t); | |
#else | |
return t; | |
#endif |
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'm not sure I see what value this brings. If the method takes in a const reference, and does whatever treatment it needs to return a non-const reference, isn't that just a more complicated way of doing a flat-out const_cast
? And if it takes in a non-const reference, then there would be no need to use const_cast
in the first place? To me this preprocessor bit is mostly to confine the const_casting to the old Hydra versions, and use the new ones for the current & future (which would also allow us to remove the old API usage at a future point should we wish to do so)
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.
It was just a suggestion for readability and being closer to Don't Repeat Yourself. You have the const_cast ifdef twice, and inside the ifdef you're repeating code. No big deal though.
lib/flowViewport/sceneIndex/fvpWireframeSelectionHighlightSceneIndex.cpp
Outdated
Show resolved
Hide resolved
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.
Thanks for the update!
#if HD_API_VERSION < 66 | ||
const_cast<HdInstancerTopologySchema&>(originalInstancerTopology).GetMask()->GetTypedValue(0); | ||
#else | ||
originalInstancerTopology.GetMask()->GetTypedValue(0); | ||
#endif |
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.
It was just a suggestion for readability and being closer to Don't Repeat Yourself. You have the const_cast ifdef twice, and inside the ifdef you're repeating code. No big deal though.
This PR implements point instance selection highlighting of meshes for point instancer, instance & prototype selections.
Note that as part of this PR, the
Fvp::PathInterface::SceneIndexPath
method was renamed toConvertUfePathToHydraSelections
, and now requires returning a vector of a new structPrimSelectionInfo
, each containing anSdfPath
and a selection data source.Following this, the lead object path tracker now also supports multiple lead prim paths.