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

Tremblp/hydra 929/custom data producer picking #140

Closed
wants to merge 5 commits into from

Conversation

ppt-adsk
Copy link
Collaborator

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 self-assigned this Jun 21, 2024
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef FVP_PATH_MAPPER_H
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we said the define should contain a part of the path like FVP_SELECTION_PATH_MAPPER_H

@ppt-adsk ppt-adsk closed this Jul 18, 2024
@ppt-adsk ppt-adsk deleted the tremblp/HYDRA-929/custom_data_producer_picking branch July 18, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants