-
Notifications
You must be signed in to change notification settings - Fork 5
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-1271 : Selection highlighting rework #240
Merged
debloip-adsk
merged 151 commits into
dev
from
debloip/HYDRA-1271/selection-highlight-refactor-2
Jan 27, 2025
Merged
HYDRA-1271 : Selection highlighting rework #240
debloip-adsk
merged 151 commits into
dev
from
debloip/HYDRA-1271/selection-highlight-refactor-2
Jan 27, 2025
Conversation
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
debloip-adsk
commented
Jan 24, 2025
lib/flowViewport/sceneIndex/wireframeHighlights/fvpPiPrototypeWhSi.cpp
Outdated
Show resolved
Hide resolved
ppt-adsk
approved these changes
Jan 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fvp-toolkit
Flow Viewport Toolkit
ready-for-merge
Development process is finished, PR is ready for merge
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.
Rework of the selection highlighting infrastructure.
Instead of having a single scene index handling all cases, the logic is now split up across multiple scene indices, each dedicated to handling highlights for a specific type of prim. The common logic between them is extracted out in a base class, which makes each scene index independent of each other. See the BaseWhSi.h doc comment for an explanation on how selection highlights are structured.
Note that sets & maps keyed by SdfPaths are heavily used in order to accelerate finding the children and/or parents of paths among a given collection. Generally speaking, lower_bound will be used to find children of a given path (or the path itself), while upper_bound followed by an iterator decrement will be used to find a parent of a path.
Existing highlighting tests were replaced by image-based tests, and new tests were added for native instancing highlighting. Reasoning behind going with image-based tests is that we don't care all that much about how the highlight prims are structured as opposed to how the result looks. And since there are a lot of cases to handle, it is much faster & simpler to go with image-based tests (and it also allows us to easily see if a case actually works or not).
Possible improvements/alternatives for the future :
MhDirtyLeadObjectSceneIndex
also forwards the dirty notifications to instancers' prototypes. However, this could be handled by the instancing-related highlight scene indices instead in order to reduce the amount of notifications sent.BaseWhSi
class into a single driver class, which would control the specialized scene indices. This would avoid having each scene index repeat the processing of theBaseWhSi
and maintain separate copies of the fully selected paths.HasFullySelectedAncestorInclusive
, hook the scene indices to the Flow Viewport selection and use theFvp::Selection
's version of the method. This would also require theFvp::Selection
to send out notifications whenever a path starts or stops being fully selected to accomodateProcessFullySelectedChange
.