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

Isolate select scene index, with command-based implementation. #164

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

ppt-adsk
Copy link
Collaborator

Implement isolate select as a scene index filter. The isolate select scene index filter removes objects (and their hierarchies) that are not visible in a given viewport, allowing the user to focus on data of interest and reducing scene load. Isolate select can be different on a per-viewport basis.

The isolate selection is kept on a per-viewport basis in the Fvp::ViewportInformationAndSceneIndicesPerViewportDataManager, keyed by model panel string (used as a viewport ID). Since we have a single scene index tree for all viewports, switching viewports means switching isolate selection. Isolate selection is implemented by setting visibility to 0 on invisible object, rather than removing these objects from the scene. This matches what is done in Maya for isolate selection. A consequence of this is that we are sharing a single scene, and its objects, among all viewports. We must therefore adjust object visibility to match the isolate selection for each viewport.

When switching from one viewport to another, the isolate scene index dirties the previous isolate selection, to remove its effect on the visibility of objects as specified for the previous viewport. We then dirty visibility as appropriate for the new isolate selection.

In this pull request the isolate select scene index is not connected to the UI, and must be set through a mayaHydra testing command, which is what is done in the unit test.

@ppt-adsk ppt-adsk requested a review from lanierd-adsk August 28, 2024 19:49
@ppt-adsk ppt-adsk self-assigned this Aug 28, 2024
const IsolateSelectSceneIndexRefPtr& sceneIndex
)
{
_isolateSelectSceneIndex = sceneIndex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there anything you need to clean up if there was a previous sceneIndex ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe so. The isolate selections exist independently of the isolate scene index.

@lanierd-adsk lanierd-adsk self-requested a review August 30, 2024 08:43
lanierd-adsk
lanierd-adsk previously approved these changes Aug 30, 2024
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Aug 30, 2024
@ppt-adsk ppt-adsk removed the ready-for-merge Development process is finished, PR is ready for merge label Aug 30, 2024
@ppt-adsk ppt-adsk assigned ppt-adsk and unassigned ppt-adsk Aug 30, 2024
@ppt-adsk ppt-adsk requested a review from lanierd-adsk August 30, 2024 14:23
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Sep 3, 2024
@roopavr-adsk roopavr-adsk added sceneindex Hydra Scene Index fvp-toolkit Flow Viewport Toolkit labels Sep 3, 2024
@roopavr-adsk roopavr-adsk merged commit d13ba28 into dev Sep 3, 2024
10 checks passed
@roopavr-adsk roopavr-adsk deleted the tremblp/HYDRA-725/isolate_select_part1 branch September 3, 2024 15:05
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 sceneindex Hydra Scene Index
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants