Loading...
Searching...
No Matches
HdxPrimOriginInfo Struct Reference

A helper to extract information about the picked prim that allows modern applications to identify a prim and, e.g., obtain the scene path such as the path of the corresponding UsdPrim. More...

#include <pickTask.h>

Public Member Functions

HDX_API SdfPath GetFullPath (const TfToken &nameInPrimOrigin=HdPrimOriginSchemaTokens->scenePath) const
 Combines instance scene paths and prim scene path to obtain the full scene path.
 
HDX_API HdInstancerContext ComputeInstancerContext (const TfToken &nameInPrimOrigin=HdPrimOriginSchemaTokens->scenePath) const
 Computes an HdInstancerContext object (equivalent to the one computed by GetScenePrimPath) from the vector of HdxInstancerContext objects.
 

Static Public Member Functions

static HDX_API HdxPrimOriginInfo FromPickHit (HdSceneIndexBaseRefPtr const &terminalSceneIndex, const HdxPickHit &hit)
 Query terminal scene index for information about picked prim.
 
static HDX_API HdxPrimOriginInfo FromPickHit (HdRenderIndex *renderIndex, const HdxPickHit &hit)
 Query terminal scene index of render index for information about picked prim.
 
static HDX_API std::vector< HdxPrimOriginInfoFromPickHits (HdSceneIndexBaseRefPtr const &terminalSceneIndex, const std::vector< HdxPickHit > &hits)
 Vectorized implementation of function to query terminal scene index for information about picked prim.
 
static HDX_API std::vector< HdxPrimOriginInfoFromPickHits (HdRenderIndex *renderIndex, const std::vector< HdxPickHit > &hits)
 Vectorized implementation of function to query terminal scene index of render index for information about picked prim.
 

Public Attributes

std::vector< HdxInstancerContextinstancerContexts
 Information about the instancers instancing the picked object.
 
HdContainerDataSourceHandle primOrigin
 The prim origin data source for the picked prim if provided by the scene index.
 

Detailed Description

A helper to extract information about the picked prim that allows modern applications to identify a prim and, e.g., obtain the scene path such as the path of the corresponding UsdPrim.

Note that this helper assumes that we use scene indices and that the primOrigin data source was populated for each pickable prim in the scene index. Typically, an application will populate the scenePath in the primOrigin data source. But the design allows an application to populate the primOrigin container data source with arbitrary data that helps to give context about a prim and identify the picked prim.

Note that legacy applications using scene delegates cannot use HdxPrimOriginInfo and have to translate the scene index path to a scene path using the scene delegate API HdSceneDelegate::GetScenePrimPath and HdSceneDelegate::ConvertIndexPathToCachePath.

Definition at line 165 of file pickTask.h.

Member Function Documentation

◆ ComputeInstancerContext()

HDX_API HdInstancerContext ComputeInstancerContext ( const TfToken nameInPrimOrigin = HdPrimOriginSchemaTokens->scenePath) const

Computes an HdInstancerContext object (equivalent to the one computed by GetScenePrimPath) from the vector of HdxInstancerContext objects.

Note that while HdxInstancerContext has a wealth of data about both scene instancers and hydra-created instancers, HdInstancerContext is meant to be just a list of (scene instancer, local instance id) tuples, used by some clients (e.g. usdview) for selection processing.

◆ FromPickHit() [1/2]

static HDX_API HdxPrimOriginInfo FromPickHit ( HdRenderIndex renderIndex,
const HdxPickHit hit 
)
static

Query terminal scene index of render index for information about picked prim.

Deprecated:
Use overload taking scene index.

◆ FromPickHit() [2/2]

static HDX_API HdxPrimOriginInfo FromPickHit ( HdSceneIndexBaseRefPtr const &  terminalSceneIndex,
const HdxPickHit hit 
)
static

Query terminal scene index for information about picked prim.

◆ FromPickHits() [1/2]

static HDX_API std::vector< HdxPrimOriginInfo > FromPickHits ( HdRenderIndex renderIndex,
const std::vector< HdxPickHit > &  hits 
)
static

Vectorized implementation of function to query terminal scene index of render index for information about picked prim.

Amortizes the cost of computing the array of all instace indices and locations for instancers.

Deprecated:
Use overload taking scene index.

◆ FromPickHits() [2/2]

static HDX_API std::vector< HdxPrimOriginInfo > FromPickHits ( HdSceneIndexBaseRefPtr const &  terminalSceneIndex,
const std::vector< HdxPickHit > &  hits 
)
static

Vectorized implementation of function to query terminal scene index for information about picked prim.

Amortizes the cost of computing the array of all instance indices and locations for instancers.

◆ GetFullPath()

HDX_API SdfPath GetFullPath ( const TfToken nameInPrimOrigin = HdPrimOriginSchemaTokens->scenePath) const

Combines instance scene paths and prim scene path to obtain the full scene path.

The scene path is extracted from the prim origin container data source by using the given key.

Member Data Documentation

◆ instancerContexts

std::vector<HdxInstancerContext> instancerContexts

Information about the instancers instancing the picked object.

The outer most instancer will be first.

Definition at line 225 of file pickTask.h.

◆ primOrigin

HdContainerDataSourceHandle primOrigin

The prim origin data source for the picked prim if provided by the scene index.

Definition at line 228 of file pickTask.h.


The documentation for this struct was generated from the following file: