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

Implement custom data provider picking and selection highlighting. #150

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Jul 18, 2024

Remove hard-coded picking restrictions and allow for plugins to provide picking and selection highlighting support. Demonstrated this in the Flow Viewport API data producer example plugin.

The main points in the branch are the following:

  • Introduction of a path mapping registry. This takes over responsibilities from the path interface scene index: placing path mapping in a scene index has proven to be inflexible and constraining. The registry allows its clients to retrieve a path mapper based on an application Ufe::Path. The path mapper converts an application Ufe::Path into one or more (in the case of instancing) Hydra scene index prim paths, which is used to set the Hydra scene index selection, therefore providing selection highlighting. Having a global registry provide this service is much simpler. I'm unsure about the terminology: in this branch I'm calling it path mapping, because I feel that is more precise than path interface, but I'm open to suggestions. Currently my PathMapper base class simply derives from PathInterface.
  • Introduction of a pick handler and associated registry. The pick handler class hierarchy was previously an implementation detail in the renderOverride.cpp implementation file, and was therefore inextensible. It has been factored out. Also, we previously used a simplistic, hard-coded scheme in renderOverride.cpp to distinguish between Maya data and USD data only, at pick time. The pick handler registry allows a plugin to provide pick handling, to convert a Hydra scene index pick result into an application selection.
  • Use the path mapping registry and the pick handler registry to add selection highlighting and picking to the Flow Viewport toolkit data producer example plugin, a locator that generates cubes in the Hydra scene index scene. Augmented the locator plugin to provide hiding and translation of individual cubes. While the code isn't necessarily as performant as it could be for production use, it demonstrates the interfaces and capabilities.

@ppt-adsk ppt-adsk requested a review from debloip-adsk July 18, 2024 17:03
@ppt-adsk ppt-adsk self-assigned this Jul 18, 2024
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jul 18, 2024
@roopavr-adsk roopavr-adsk merged commit 827a42e into dev Jul 22, 2024
10 checks passed
@roopavr-adsk roopavr-adsk deleted the tremblp/HYDRA-929/custom_data_producer_picking branch July 22, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants