Isolate select scene index, with command-based implementation. #164
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.
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.