This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UsdImagingDelegate Class Reference

The primary translation layer between the Hydra (Hd) core and the Usd scene graph. More...

#include <delegate.h>

+ Inheritance diagram for UsdImagingDelegate:

Public Types

typedef TfHashMap< SdfPath, GfMatrix4d, SdfPath::Hash > RigidXformOverridesMap
 
typedef PxOsdSubdivTags SubdivTags
 

Public Member Functions

USDIMAGING_API UsdImagingDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID)
 
virtual USDIMAGING_API void Sync (HdSyncRequestVector *request) override
 Synchronizes the delegate state for the given request vector.
 
USDIMAGING_API void SyncAll (bool includeUnvarying)
 
USDIMAGING_API void Populate (UsdPrim const &rootPrim)
 Populates the rootPrim in the HdRenderIndex.
 
USDIMAGING_API void Populate (UsdPrim const &rootPrim, SdfPathVector const &excludedPrimPaths, SdfPathVector const &invisedPrimPaths=SdfPathVector())
 Populates the rootPrim in the HdRenderIndex, excluding all paths in the excludedPrimPaths, as well as their prim children.
 
USDIMAGING_API void SetTime (UsdTimeCode time)
 Sets the current time from which data will be read by the delegate.
 
UsdTimeCode GetTime () const
 Returns the current time.
 
UsdTimeCode GetTimeWithOffset (float offset) const
 Apply a relative offset to the current time.
 
USDIMAGING_API void ApplyPendingUpdates ()
 Applies any scene edits which have been queued up by notices from USD.
 
int GetRefineLevelFallback () const
 Returns the refinement level that is used when prims have no explicit level set.
 
USDIMAGING_API void SetRefineLevelFallback (int level)
 Sets the fallback refinement level to level, triggers dirty refine level bit to be set on all Rprims that don't have explicit refine levels set.
 
USDIMAGING_API void ClearRefineLevel (SdfPath const &usdPath)
 Removes any explicit refine level set for the given USD prim.
 
USDIMAGING_API void SetRefineLevel (SdfPath const &usdPath, int level)
 Sets an explicit refinement level for the given USD prim.
 
HdReprSelector GetReprFallback () const
 Returns the fallback repr name.
 
USDIMAGING_API void SetReprFallback (HdReprSelector const &repr)
 Sets the fallback repr name.
 
HdCullStyle GetCullStyleFallback () const
 Returns the fallback cull style.
 
USDIMAGING_API void SetCullStyleFallback (HdCullStyle cullStyle)
 Sets the fallback cull style.
 
USDIMAGING_API void SetRootTransform (GfMatrix4d const &xf)
 Sets the root transform for the entire delegate, which is applied to all render prims generated.
 
const GfMatrix4dGetRootTransform () const
 Returns the root transform for the entire delegate.
 
USDIMAGING_API void SetRootVisibility (bool isVisible)
 Sets the root visibility for the entire delegate, which is applied to all render prims generated.
 
bool GetRootVisibility () const
 Returns the root visibility for the entire delegate.
 
USDIMAGING_API void SetRootInstancerId (SdfPath const &instancerId)
 Sets the root instancer id for the entire delegate, which is used as a fallback value for GetInstancerId.
 
SdfPath GetRootInstancerId () const
 Returns the root instancer id for the entire delegate.
 
USDIMAGING_API void SetInvisedPrimPaths (SdfPathVector const &invisedPaths)
 Set the list of paths that must be invised.
 
USDIMAGING_API void SetRigidXformOverrides (RigidXformOverridesMap const &overrides)
 Set transform value overrides on a set of paths.
 
USDIMAGING_API void SetDisplayRender (const bool displayRender)
 Sets display of prims with purpose "render".
 
bool GetDisplayRender () const
 
USDIMAGING_API void SetDisplayProxy (const bool displayProxy)
 Sets display of prims with purpose "proxy".
 
bool GetDisplayProxy () const
 
USDIMAGING_API void SetDisplayGuides (const bool displayGuides)
 Sets display of prims with purpose "guide".
 
bool GetDisplayGuides () const
 
USDIMAGING_API void SetUsdDrawModesEnabled (bool enableUsdDrawModes)
 Returns whether draw modes are enabled.
 
bool GetUsdDrawModesEnabled () const
 
USDIMAGING_API void SetSceneMaterialsEnabled (bool enable)
 Enables custom shading on prims.
 
USDIMAGING_API void SetSceneLightsEnabled (bool enable)
 Enables lights found in the usdscene.
 
USDIMAGING_API void SetWindowPolicy (CameraUtilConformWindowPolicy policy)
 Set the window policy on all scene cameras.
 
USDIMAGING_API void SetDisplayUnloadedPrimsWithBounds (bool displayUnloaded)
 Sets display of unloaded prims as bounding boxes.
 
bool GetDisplayUnloadedPrimsWithBounds () const
 
USDIMAGING_API void SetCameraForSampling (SdfPath const &id)
 Setup for the shutter open and close to be used for motion sampling.
 
USDIMAGING_API GfInterval GetCurrentTimeSamplingInterval ()
 Returns the current interval that will be used when using the sample* API in the scene delegate.
 
virtual USDIMAGING_API TfToken GetRenderTag (SdfPath const &id) override
 Returns the render tag that will be used to bucket prims during render pass bucketing.
 
virtual USDIMAGING_API HdMeshTopology GetMeshTopology (SdfPath const &id) override
 Gets the topological mesh data for a given prim.
 
virtual USDIMAGING_API HdBasisCurvesTopology GetBasisCurvesTopology (SdfPath const &id) override
 Gets the topological curve data for a given prim.
 
virtual USDIMAGING_API SubdivTags GetSubdivTags (SdfPath const &id) override
 Gets the subdivision surface tags (sharpness, holes, etc).
 
virtual USDIMAGING_API GfRange3d GetExtent (SdfPath const &id) override
 Gets the axis aligned bounds of a prim.
 
virtual USDIMAGING_API GfMatrix4d GetTransform (SdfPath const &id) override
 Returns the object space transform, including all parent transforms.
 
virtual USDIMAGING_API bool GetVisible (SdfPath const &id) override
 Returns the authored visible state of the prim.
 
virtual USDIMAGING_API bool GetDoubleSided (SdfPath const &id) override
 Returns the doubleSided state for the given prim.
 
virtual USDIMAGING_API HdCullStyle GetCullStyle (SdfPath const &id) override
 Returns the cullstyle for the given prim.
 
virtual USDIMAGING_API HdDisplayStyle GetDisplayStyle (SdfPath const &id) override
 Gets the explicit display style for the given prim, if no refine level is explicitly set, the fallback is returned; also see GetRefineLevelFallback().
 
USDIMAGING_API HdModelDrawMode GetModelDrawMode (SdfPath const &id) override
 Returns the model draw mode object for the given prim.
 
virtual USDIMAGING_API VtValue Get (SdfPath const &id, TfToken const &key) override
 Returns a named value.
 
virtual USDIMAGING_API VtValue GetIndexedPrimvar (SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
 Returns a named primvar value.
 
USDIMAGING_API virtual HdIdVectorSharedPtr GetCoordSysBindings (SdfPath const &id) override
 Returns the coordinate system bindings, or a nullptr if none are bound.
 
virtual USDIMAGING_API HdReprSelector GetReprSelector (SdfPath const &id) override
 Returns the authored repr (if any) for the given prim.
 
virtual USDIMAGING_API VtArray< TfTokenGetCategories (SdfPath const &id) override
 Returns the prim categories.
 
virtual USDIMAGING_API std::vector< VtArray< TfToken > > GetInstanceCategories (SdfPath const &instancerId) override
 Returns the categories for each of the instances in the instancer.
 
virtual USDIMAGING_API HdPrimvarDescriptorVector GetPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolation) override
 Returns descriptors for all primvars of the given interpolation type.
 
virtual USDIMAGING_API VtIntArray GetInstanceIndices (SdfPath const &instancerId, SdfPath const &prototypeId) override
 Gets the extracted indices array of the prototype id used in the instancer.
 
virtual USDIMAGING_API GfMatrix4d GetInstancerTransform (SdfPath const &instancerId) override
 Returns the instancer transform.
 
virtual USDIMAGING_API SdfPath GetInstancerId (SdfPath const &primId) override
 Returns the parent instancer of the given rprim or instancer.
 
virtual USDIMAGING_API SdfPathVector GetInstancerPrototypes (SdfPath const &instancerId) override
 Returns a list of prototypes of this instancer.
 
virtual USDIMAGING_API size_t SampleTransform (SdfPath const &id, size_t maxNumSamples, float *times, GfMatrix4d *samples) override
 Store up to maxSampleCount transform samples in *sampleValues.
 
virtual USDIMAGING_API size_t SampleInstancerTransform (SdfPath const &instancerId, size_t maxSampleCount, float *times, GfMatrix4d *samples) override
 Store up to maxSampleCount transform samples in *sampleValues.
 
virtual USDIMAGING_API size_t SamplePrimvar (SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples) override
 Store up to maxSampleCount primvar samples in *samplesValues.
 
virtual USDIMAGING_API size_t SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *indices) override
 SamplePrimvar() for getting an unflattened primvar and its indices.
 
virtual USDIMAGING_API SdfPath GetMaterialId (SdfPath const &rprimId) override
 Returns the material ID bound to the rprim rprimId.
 
virtual USDIMAGING_API VtValue GetMaterialResource (SdfPath const &materialId) override
 
virtual USDIMAGING_API VtValue GetLightParamValue (SdfPath const &id, TfToken const &paramName) override
 
virtual USDIMAGING_API VtValue GetCameraParamValue (SdfPath const &id, TfToken const &paramName) override
 Returns a single value for a given camera and parameter.
 
virtual USDIMAGING_API HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors (SdfPath const &volumeId) override
 
virtual USDIMAGING_API SdfPath GetScenePrimPath (SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr) override
 Returns the scene address of the prim corresponding to the given rprim/instance index.
 
virtual USDIMAGING_API SdfPathVector GetScenePrimPaths (SdfPath const &rprimId, std::vector< int > instanceIndices, std::vector< HdInstancerContext > *instancerContexts=nullptr) override
 A vectorized version of GetScenePrimPath that allows the prim adapter to amortize expensive calculations across a number of path evaluations in a single call.
 
USDIMAGING_API TfTokenVector GetExtComputationSceneInputNames (SdfPath const &computationId) override
 For the given computation id, returns a list of inputs which will be requested from the scene delegate using the Get() method.
 
USDIMAGING_API HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors (SdfPath const &computationId) override
 For the given computation id, returns a list of computation input descriptors.
 
USDIMAGING_API HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors (SdfPath const &computationId) override
 For the given computation id, returns a list of computation output descriptors.
 
USDIMAGING_API HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors (SdfPath const &computationId, HdInterpolation interpolation) override
 Returns a list of primvar names that should be bound to a generated output from an ExtComputation for the given prim id and interpolation mode.
 
USDIMAGING_API VtValue GetExtComputationInput (SdfPath const &computationId, TfToken const &input) override
 Returns a single value for a given computation id and input token.
 
USDIMAGING_API size_t SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
 Return up to maxSampleCount samples for a given computation id and input token.
 
USDIMAGING_API std::string GetExtComputationKernel (SdfPath const &computationId) override
 Returns the kernel source assigned to the computation at the path id.
 
USDIMAGING_API void InvokeExtComputation (SdfPath const &computationId, HdExtComputationContext *context) override
 Requests the scene delegate run the ExtComputation with the given id.
 
USDIMAGING_API SdfPath ConvertCachePathToIndexPath (SdfPath const &cachePath)
 
USDIMAGING_API SdfPath ConvertIndexPathToCachePath (SdfPath const &indexPath)
 Convert the given Hydra ID to a UsdImaging cache path, by stripping the scene delegate prefix.
 
USDIMAGING_API bool PopulateSelection (HdSelection::HighlightMode const &highlightMode, const SdfPath &usdPath, int instanceIndex, HdSelectionSharedPtr const &result)
 
USDIMAGING_API bool IsInInvisedPaths (const SdfPath &usdPath) const
 Returns true if usdPath is included in invised path list.
 
- Public Member Functions inherited from HdSceneDelegate
HD_API HdSceneDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID)
 Constructor used for nested delegate objects which share a RenderIndex.
 
HdRenderIndexGetRenderIndex ()
 Returns the RenderIndex owned by this delegate.
 
SdfPath const & GetDelegateID () const
 Returns the ID of this delegate, which is used as a prefix for all objects it creates in the RenderIndex.
 
virtual HD_API void Sync (HdSyncRequestVector *request)
 Synchronizes the delegate state for the given request vector.
 
virtual HD_API void PostSyncCleanup ()
 Opportunity for the delegate to clean itself up after performing parallel work during sync phase.
 
virtual HD_API bool IsEnabled (TfToken const &option) const
 Returns true if the named option is enabled by the delegate.
 
virtual HD_API VtValue GetShadingStyle (SdfPath const &id)
 Returns the shading style for the given prim.
 
virtual HD_API size_t SampleTransform (SdfPath const &id, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
 
template<unsigned int CAPACITY>
void SampleTransform (SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleTransform() that takes an HdTimeSampleArray.
 
template<unsigned int CAPACITY>
void SampleTransform (SdfPath const &id, float startTime, float endTime, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleTransform() that takes an HdTimeSampleArray.
 
virtual HD_API size_t SampleInstancerTransform (SdfPath const &instancerId, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
 
template<unsigned int CAPACITY>
void SampleInstancerTransform (SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray.
 
template<unsigned int CAPACITY>
void SampleInstancerTransform (SdfPath const &instancerId, float startTime, float endTime, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray.
 
virtual HD_API size_t SamplePrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
 
template<unsigned int CAPACITY>
void SamplePrimvar (SdfPath const &id, TfToken const &key, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SamplePrimvar() that takes an HdTimeSampleArray.
 
template<unsigned int CAPACITY>
void SamplePrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SamplePrimvar() that takes an HdTimeSampleArray.
 
virtual HD_API size_t SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues, VtIntArray *sampleIndices)
 
template<unsigned int CAPACITY>
void SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleIndexedPrimvar() that takes HdTimeSampleArrays.
 
template<unsigned int CAPACITY>
void SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, float startTime, float endTime, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleIndexedPrimvar() that takes HdTimeSampleArrays.
 
virtual HD_API HdRenderBufferDescriptor GetRenderBufferDescriptor (SdfPath const &id)
 Returns the allocation descriptor for a given render buffer prim.
 
virtual HD_API size_t SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, float startTime, float endTime, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues)
 
template<unsigned int CAPACITY>
void SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray.
 
template<unsigned int CAPACITY>
void SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, float startTime, float endTime, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray.
 
virtual HD_API TfTokenVector GetTaskRenderTags (SdfPath const &taskId)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Static Public Member Functions

static USDIMAGING_API void SetTimes (const std::vector< UsdImagingDelegate * > &delegates, const std::vector< UsdTimeCode > &times)
 For each delegate in delegates, sets the current time from which data wil be read to the corresponding time in times.
 

Static Public Attributes

static constexpr int ALL_INSTANCES = -1
 Populate HdxSelection for given path (root) and instanceIndex.
 

Friends

class UsdImagingIndexProxy
 
class UsdImagingPrimAdapter
 

Additional Inherited Members

- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

The primary translation layer between the Hydra (Hd) core and the Usd scene graph.

Definition at line 67 of file delegate.h.

Member Typedef Documentation

◆ RigidXformOverridesMap

typedef TfHashMap<SdfPath, GfMatrix4d, SdfPath::Hash> RigidXformOverridesMap

Definition at line 71 of file delegate.h.

◆ SubdivTags

Definition at line 274 of file delegate.h.

Member Function Documentation

◆ ApplyPendingUpdates()

USDIMAGING_API void ApplyPendingUpdates ( )

Applies any scene edits which have been queued up by notices from USD.

◆ ClearRefineLevel()

USDIMAGING_API void ClearRefineLevel ( SdfPath const &  usdPath)

Removes any explicit refine level set for the given USD prim.

Marks dirty if a change in level occurs.

◆ ConvertCachePathToIndexPath()

USDIMAGING_API SdfPath ConvertCachePathToIndexPath ( SdfPath const &  cachePath)
inline

Definition at line 438 of file delegate.h.

◆ ConvertIndexPathToCachePath()

USDIMAGING_API SdfPath ConvertIndexPathToCachePath ( SdfPath const &  indexPath)
inline

Convert the given Hydra ID to a UsdImaging cache path, by stripping the scene delegate prefix.

The UsdImaging cache path is the same as a USD prim path, except for instanced prims, which get a name-mangled encoding.

Definition at line 462 of file delegate.h.

◆ Get()

virtual USDIMAGING_API VtValue Get ( SdfPath const &  id,
TfToken const &  key 
)
overridevirtual

Returns a named value.

Reimplemented from HdSceneDelegate.

◆ GetBasisCurvesTopology()

virtual USDIMAGING_API HdBasisCurvesTopology GetBasisCurvesTopology ( SdfPath const &  id)
overridevirtual

Gets the topological curve data for a given prim.

Reimplemented from HdSceneDelegate.

◆ GetCameraParamValue()

virtual USDIMAGING_API VtValue GetCameraParamValue ( SdfPath const &  cameraId,
TfToken const &  paramName 
)
overridevirtual

Returns a single value for a given camera and parameter.

See HdCameraTokens for the list of paramters.

Reimplemented from HdSceneDelegate.

◆ GetCategories()

virtual USDIMAGING_API VtArray< TfToken > GetCategories ( SdfPath const &  id)
overridevirtual

Returns the prim categories.

For instancer prims, the categories returned apply to all its instances.

Reimplemented from HdSceneDelegate.

◆ GetCoordSysBindings()

USDIMAGING_API virtual HdIdVectorSharedPtr GetCoordSysBindings ( SdfPath const &  id)
overridevirtual

Returns the coordinate system bindings, or a nullptr if none are bound.

Reimplemented from HdSceneDelegate.

◆ GetCullStyle()

virtual USDIMAGING_API HdCullStyle GetCullStyle ( SdfPath const &  id)
overridevirtual

Returns the cullstyle for the given prim.

Reimplemented from HdSceneDelegate.

◆ GetCullStyleFallback()

HdCullStyle GetCullStyleFallback ( ) const
inline

Returns the fallback cull style.

Definition at line 168 of file delegate.h.

◆ GetCurrentTimeSamplingInterval()

USDIMAGING_API GfInterval GetCurrentTimeSamplingInterval ( )

Returns the current interval that will be used when using the sample* API in the scene delegate.

◆ GetDisplayGuides()

bool GetDisplayGuides ( ) const
inline

Definition at line 221 of file delegate.h.

◆ GetDisplayProxy()

bool GetDisplayProxy ( ) const
inline

Definition at line 216 of file delegate.h.

◆ GetDisplayRender()

bool GetDisplayRender ( ) const
inline

Definition at line 211 of file delegate.h.

◆ GetDisplayStyle()

virtual USDIMAGING_API HdDisplayStyle GetDisplayStyle ( SdfPath const &  id)
overridevirtual

Gets the explicit display style for the given prim, if no refine level is explicitly set, the fallback is returned; also see GetRefineLevelFallback().

Reimplemented from HdSceneDelegate.

◆ GetDisplayUnloadedPrimsWithBounds()

bool GetDisplayUnloadedPrimsWithBounds ( ) const
inline

Definition at line 251 of file delegate.h.

◆ GetDoubleSided()

virtual USDIMAGING_API bool GetDoubleSided ( SdfPath const &  id)
overridevirtual

Returns the doubleSided state for the given prim.

Reimplemented from HdSceneDelegate.

◆ GetExtComputationInput()

USDIMAGING_API VtValue GetExtComputationInput ( SdfPath const &  computationId,
TfToken const &  input 
)
overridevirtual

Returns a single value for a given computation id and input token.

The token may be a computation input or a computation config parameter.

Reimplemented from HdSceneDelegate.

◆ GetExtComputationInputDescriptors()

USDIMAGING_API HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors ( SdfPath const &  computationId)
overridevirtual

For the given computation id, returns a list of computation input descriptors.

See HdExtComputationInputDecriptor

Reimplemented from HdSceneDelegate.

◆ GetExtComputationKernel()

USDIMAGING_API std::string GetExtComputationKernel ( SdfPath const &  computationId)
overridevirtual

Returns the kernel source assigned to the computation at the path id.

If the string is empty the computation has no GPU kernel and the CPU callback should be used.

Reimplemented from HdSceneDelegate.

◆ GetExtComputationOutputDescriptors()

USDIMAGING_API HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors ( SdfPath const &  computationId)
overridevirtual

For the given computation id, returns a list of computation output descriptors.

See HdExtComputationOutputDescriptor

Reimplemented from HdSceneDelegate.

◆ GetExtComputationPrimvarDescriptors()

USDIMAGING_API HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors ( SdfPath const &  id,
HdInterpolation  interpolationMode 
)
overridevirtual

Returns a list of primvar names that should be bound to a generated output from an ExtComputation for the given prim id and interpolation mode.

Binding information is obtained through GetExtComputationPrimvarDesc() Returns a structure describing source information for a primvar that is bound to an ExtComputation. See HdExtComputationPrimvarDesc for the expected information to be returned.

Reimplemented from HdSceneDelegate.

◆ GetExtComputationSceneInputNames()

USDIMAGING_API TfTokenVector GetExtComputationSceneInputNames ( SdfPath const &  computationId)
overridevirtual

For the given computation id, returns a list of inputs which will be requested from the scene delegate using the Get() method.

See GetExtComputationInputDescriptors and GetExtComputationOutpuDescriptors for descriptions of other computation inputs and outputs.

Reimplemented from HdSceneDelegate.

◆ GetExtent()

virtual USDIMAGING_API GfRange3d GetExtent ( SdfPath const &  id)
overridevirtual

Gets the axis aligned bounds of a prim.

The returned bounds are in the local space of the prim (transform is yet to be applied) and should contain the bounds of any child prims.

The returned bounds does not include any displacement that might occur as the result of running shaders on the prim.

Reimplemented from HdSceneDelegate.

◆ GetIndexedPrimvar()

virtual USDIMAGING_API VtValue GetIndexedPrimvar ( SdfPath const &  id,
TfToken const &  key,
VtIntArray *  outIndices 
)
overridevirtual

Returns a named primvar value.

If *outIndices is not nullptr and the primvar has indices, it will return the unflattened primvar and set *outIndices to the primvar's associated indices, clearing the array if the primvar is not indexed.

Reimplemented from HdSceneDelegate.

◆ GetInstanceCategories()

virtual USDIMAGING_API std::vector< VtArray< TfToken > > GetInstanceCategories ( SdfPath const &  instancerId)
overridevirtual

Returns the categories for each of the instances in the instancer.

Reimplemented from HdSceneDelegate.

◆ GetInstanceIndices()

virtual USDIMAGING_API VtIntArray GetInstanceIndices ( SdfPath const &  instancerId,
SdfPath const &  prototypeId 
)
overridevirtual

Gets the extracted indices array of the prototype id used in the instancer.

example instances: 0, 1, 2, 3, 4, 5 protoypes: A, B, A, A, B, C

GetInstanceIndices(A) : [0, 2, 3] GetInstanceIndices(B) : [1, 4] GetInstanceIndices(C) : [5] GetInstanceIndices(D) : []

Reimplemented from HdSceneDelegate.

◆ GetInstancerId()

virtual USDIMAGING_API SdfPath GetInstancerId ( SdfPath const &  primId)
overridevirtual

Returns the parent instancer of the given rprim or instancer.

Reimplemented from HdSceneDelegate.

◆ GetInstancerPrototypes()

virtual USDIMAGING_API SdfPathVector GetInstancerPrototypes ( SdfPath const &  instancerId)
overridevirtual

Returns a list of prototypes of this instancer.

The intent is to let renderers cache instance indices by giving them a complete set of prims to call GetInstanceIndices(instancer, prototype) on. XXX: This is currently unused, but may be used in the future.

Reimplemented from HdSceneDelegate.

◆ GetInstancerTransform()

virtual USDIMAGING_API GfMatrix4d GetInstancerTransform ( SdfPath const &  instancerId)
overridevirtual

Returns the instancer transform.

Reimplemented from HdSceneDelegate.

◆ GetLightParamValue()

virtual USDIMAGING_API VtValue GetLightParamValue ( SdfPath const &  id,
TfToken const &  paramName 
)
overridevirtual

Reimplemented from HdSceneDelegate.

◆ GetMaterialId()

virtual USDIMAGING_API SdfPath GetMaterialId ( SdfPath const &  rprimId)
overridevirtual

Returns the material ID bound to the rprim rprimId.

Reimplemented from HdSceneDelegate.

◆ GetMaterialResource()

virtual USDIMAGING_API VtValue GetMaterialResource ( SdfPath const &  materialId)
overridevirtual

Reimplemented from HdSceneDelegate.

◆ GetMeshTopology()

virtual USDIMAGING_API HdMeshTopology GetMeshTopology ( SdfPath const &  id)
overridevirtual

Gets the topological mesh data for a given prim.

Reimplemented from HdSceneDelegate.

◆ GetModelDrawMode()

USDIMAGING_API HdModelDrawMode GetModelDrawMode ( SdfPath const &  id)
overridevirtual

Returns the model draw mode object for the given prim.

Reimplemented from HdSceneDelegate.

◆ GetPrimvarDescriptors()

virtual USDIMAGING_API HdPrimvarDescriptorVector GetPrimvarDescriptors ( SdfPath const &  id,
HdInterpolation  interpolation 
)
overridevirtual

Returns descriptors for all primvars of the given interpolation type.

Reimplemented from HdSceneDelegate.

◆ GetRefineLevelFallback()

int GetRefineLevelFallback ( ) const
inline

Returns the refinement level that is used when prims have no explicit level set.

The refinement level indicates how many iterations to apply when subdividing subdivision surfaces or other refinable primitives.

Refinement level is always in the range [0,8].

Definition at line 135 of file delegate.h.

◆ GetRenderTag()

virtual USDIMAGING_API TfToken GetRenderTag ( SdfPath const &  id)
overridevirtual

Returns the render tag that will be used to bucket prims during render pass bucketing.

Reimplemented from HdSceneDelegate.

◆ GetReprFallback()

HdReprSelector GetReprFallback ( ) const
inline

Returns the fallback repr name.

Definition at line 160 of file delegate.h.

◆ GetReprSelector()

virtual USDIMAGING_API HdReprSelector GetReprSelector ( SdfPath const &  id)
overridevirtual

Returns the authored repr (if any) for the given prim.

Reimplemented from HdSceneDelegate.

◆ GetRootInstancerId()

SdfPath GetRootInstancerId ( ) const
inline

Returns the root instancer id for the entire delegate.

Definition at line 198 of file delegate.h.

◆ GetRootTransform()

const GfMatrix4d & GetRootTransform ( ) const
inline

Returns the root transform for the entire delegate.

Definition at line 181 of file delegate.h.

◆ GetRootVisibility()

bool GetRootVisibility ( ) const
inline

Returns the root visibility for the entire delegate.

Definition at line 190 of file delegate.h.

◆ GetScenePrimPath()

virtual USDIMAGING_API SdfPath GetScenePrimPath ( SdfPath const &  rprimId,
int  instanceIndex,
HdInstancerContext *  instancerContext = nullptr 
)
overridevirtual

Returns the scene address of the prim corresponding to the given rprim/instance index.

This is designed to give paths in scene namespace, rather than hydra namespace, so it always strips the delegate ID.

Deprecated:
use GetScenePrimPaths

Reimplemented from HdSceneDelegate.

◆ GetScenePrimPaths()

virtual USDIMAGING_API SdfPathVector GetScenePrimPaths ( SdfPath const &  rprimId,
std::vector< int >  instanceIndices,
std::vector< HdInstancerContext > *  instancerContexts = nullptr 
)
overridevirtual

A vectorized version of GetScenePrimPath that allows the prim adapter to amortize expensive calculations across a number of path evaluations in a single call.

Note that only a single rprimId is supported. This allows this call to be forwarded directly to a single prim adapter rather than requiring a lot of data shuffling.

Reimplemented from HdSceneDelegate.

◆ GetSubdivTags()

virtual USDIMAGING_API SubdivTags GetSubdivTags ( SdfPath const &  id)
overridevirtual

Gets the subdivision surface tags (sharpness, holes, etc).

Reimplemented from HdSceneDelegate.

◆ GetTime()

UsdTimeCode GetTime ( ) const
inline

Returns the current time.

Definition at line 118 of file delegate.h.

◆ GetTimeWithOffset()

UsdTimeCode GetTimeWithOffset ( float  offset) const

Apply a relative offset to the current time.

This has no effect in the case of the default USD timecode.

◆ GetTransform()

virtual USDIMAGING_API GfMatrix4d GetTransform ( SdfPath const &  id)
overridevirtual

Returns the object space transform, including all parent transforms.

Reimplemented from HdSceneDelegate.

◆ GetUsdDrawModesEnabled()

bool GetUsdDrawModesEnabled ( ) const
inline

Definition at line 226 of file delegate.h.

◆ GetVisible()

virtual USDIMAGING_API bool GetVisible ( SdfPath const &  id)
overridevirtual

Returns the authored visible state of the prim.

Reimplemented from HdSceneDelegate.

◆ GetVolumeFieldDescriptors()

virtual USDIMAGING_API HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors ( SdfPath const &  volumeId)
overridevirtual

Reimplemented from HdSceneDelegate.

◆ InvokeExtComputation()

USDIMAGING_API void InvokeExtComputation ( SdfPath const &  computationId,
HdExtComputationContext context 
)
overridevirtual

Requests the scene delegate run the ExtComputation with the given id.

The context contains the input values that delegate requested through GetExtComputationInputNames().

The scene delegate is expected to set each output identified by GetExtComputationOutputNames() on the context.

Hydra may invoke the computation on a different thread from what HdEngine::Execute() was called on. It may also invoke many computations in parallel.

Reimplemented from HdSceneDelegate.

◆ IsInInvisedPaths()

USDIMAGING_API bool IsInInvisedPaths ( const SdfPath usdPath) const

Returns true if usdPath is included in invised path list.

◆ Populate() [1/2]

USDIMAGING_API void Populate ( UsdPrim const &  rootPrim)

Populates the rootPrim in the HdRenderIndex.

◆ Populate() [2/2]

USDIMAGING_API void Populate ( UsdPrim const &  rootPrim,
SdfPathVector const &  excludedPrimPaths,
SdfPathVector const &  invisedPrimPaths = SdfPathVector() 
)

Populates the rootPrim in the HdRenderIndex, excluding all paths in the excludedPrimPaths, as well as their prim children.

◆ SampleExtComputationInput()

USDIMAGING_API size_t SampleExtComputationInput ( SdfPath const &  computationId,
TfToken const &  input,
size_t  maxSampleCount,
float *  sampleTimes,
VtValue sampleValues 
)
overridevirtual

Return up to maxSampleCount samples for a given computation id and input token.

The token may be a computation input or a computation config parameter. Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.

Reimplemented from HdSceneDelegate.

◆ SampleIndexedPrimvar()

virtual USDIMAGING_API size_t SampleIndexedPrimvar ( SdfPath const &  id,
TfToken const &  key,
size_t  maxSampleCount,
float *  sampleTimes,
VtValue sampleValues,
VtIntArray *  sampleIndices 
)
overridevirtual

SamplePrimvar() for getting an unflattened primvar and its indices.

If *sampleIndices is not nullptr and the primvar has indices, it will return unflattened primvar samples in *sampleValues and the primvar's sampled indices in *sampleIndices, clearing the *sampleIndices array if the primvar is not indexed.

Reimplemented from HdSceneDelegate.

◆ SampleInstancerTransform()

virtual USDIMAGING_API size_t SampleInstancerTransform ( SdfPath const &  instancerId,
size_t  maxSampleCount,
float *  sampleTimes,
GfMatrix4d sampleValues 
)
overridevirtual

Store up to maxSampleCount transform samples in *sampleValues.

Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.

See also
GetInstancerTransform()

Reimplemented from HdSceneDelegate.

◆ SamplePrimvar()

virtual USDIMAGING_API size_t SamplePrimvar ( SdfPath const &  id,
TfToken const &  key,
size_t  maxSampleCount,
float *  sampleTimes,
VtValue sampleValues 
)
overridevirtual

Store up to maxSampleCount primvar samples in *samplesValues.

Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data.

Sample values that are array-valued will have a size described by the HdPrimvarDescriptor as applied to the toplogy.

For example, this means that a mesh that is fracturing over time will return samples with the same number of points; the number of points will change as the scene delegate is resynchronized to represent the scene at a time with different topology.

Sample times are relative to the scene delegate's current time.

See also
Get()

Reimplemented from HdSceneDelegate.

◆ SampleTransform()

virtual USDIMAGING_API size_t SampleTransform ( SdfPath const &  id,
size_t  maxSampleCount,
float *  sampleTimes,
GfMatrix4d sampleValues 
)
overridevirtual

Store up to maxSampleCount transform samples in *sampleValues.

Returns the union of the authored samples and the boundaries of the current camera shutter interval. If this number is greater than maxSampleCount, you might want to call this function again to get all the authored data. Sample times are relative to the scene delegate's current time.

See also
GetTransform()

Reimplemented from HdSceneDelegate.

◆ SetCameraForSampling()

USDIMAGING_API void SetCameraForSampling ( SdfPath const &  id)

Setup for the shutter open and close to be used for motion sampling.

◆ SetCullStyleFallback()

USDIMAGING_API void SetCullStyleFallback ( HdCullStyle  cullStyle)

Sets the fallback cull style.

◆ SetDisplayGuides()

USDIMAGING_API void SetDisplayGuides ( const bool  displayGuides)

Sets display of prims with purpose "guide".

◆ SetDisplayProxy()

USDIMAGING_API void SetDisplayProxy ( const bool  displayProxy)

Sets display of prims with purpose "proxy".

◆ SetDisplayRender()

USDIMAGING_API void SetDisplayRender ( const bool  displayRender)

Sets display of prims with purpose "render".

◆ SetDisplayUnloadedPrimsWithBounds()

USDIMAGING_API void SetDisplayUnloadedPrimsWithBounds ( bool  displayUnloaded)

Sets display of unloaded prims as bounding boxes.

Unloaded prims will need to satisfy one of the following set of conditions in order to see them:

  1. The prim is a UsdGeomBoundable with an authored 'extent' attribute.
  2. The prim is a UsdPrim.IsModel() and has an authored 'extentsHint' attribute (see UsdGeomModelAPI::GetExtentsHint). Effective only for delegates that support draw modes (see GetUsdDrawModesEnabled()).

◆ SetInvisedPrimPaths()

USDIMAGING_API void SetInvisedPrimPaths ( SdfPathVector const &  invisedPaths)

Set the list of paths that must be invised.

◆ SetRefineLevel()

USDIMAGING_API void SetRefineLevel ( SdfPath const &  usdPath,
int  level 
)

Sets an explicit refinement level for the given USD prim.

If no level is explicitly set, the fallback is used; see GetRefineLevelFallback(). If setting an explicit level does not change the effective level, no dirty bit is set.

◆ SetRefineLevelFallback()

USDIMAGING_API void SetRefineLevelFallback ( int  level)

Sets the fallback refinement level to level, triggers dirty refine level bit to be set on all Rprims that don't have explicit refine levels set.

Level is expected to be in the range [0,8], where 0 indicates no refinement.

◆ SetReprFallback()

USDIMAGING_API void SetReprFallback ( HdReprSelector const &  repr)

Sets the fallback repr name.

Note that currently UsdImagingDelegate doesn't support per-prim repr.

◆ SetRigidXformOverrides()

USDIMAGING_API void SetRigidXformOverrides ( RigidXformOverridesMap const &  overrides)

Set transform value overrides on a set of paths.

◆ SetRootInstancerId()

USDIMAGING_API void SetRootInstancerId ( SdfPath const &  instancerId)

Sets the root instancer id for the entire delegate, which is used as a fallback value for GetInstancerId.

◆ SetRootTransform()

USDIMAGING_API void SetRootTransform ( GfMatrix4d const &  xf)

Sets the root transform for the entire delegate, which is applied to all render prims generated.

Setting this value will immediately invalidate existing rprim transforms.

◆ SetRootVisibility()

USDIMAGING_API void SetRootVisibility ( bool  isVisible)

Sets the root visibility for the entire delegate, which is applied to all render prims generated.

Setting this value will immediately invalidate existing rprim visibility.

◆ SetSceneLightsEnabled()

USDIMAGING_API void SetSceneLightsEnabled ( bool  enable)

Enables lights found in the usdscene.

◆ SetSceneMaterialsEnabled()

USDIMAGING_API void SetSceneMaterialsEnabled ( bool  enable)

Enables custom shading on prims.

◆ SetTime()

USDIMAGING_API void SetTime ( UsdTimeCode  time)

Sets the current time from which data will be read by the delegate.

Changing the current time immediately triggers invalidation in the HdChangeTracker. Redundantly setting the time to its existing value is a no-op and will not trigger invalidation.

◆ SetTimes()

static USDIMAGING_API void SetTimes ( const std::vector< UsdImagingDelegate * > &  delegates,
const std::vector< UsdTimeCode > &  times 
)
static

For each delegate in delegates, sets the current time from which data wil be read to the corresponding time in times.

This is equivalent to calling SetTime on each delegate individually. However, this method will try to parallelize certain operations, making it potentially more efficient.

◆ SetUsdDrawModesEnabled()

USDIMAGING_API void SetUsdDrawModesEnabled ( bool  enableUsdDrawModes)

Returns whether draw modes are enabled.

◆ SetWindowPolicy()

USDIMAGING_API void SetWindowPolicy ( CameraUtilConformWindowPolicy  policy)

Set the window policy on all scene cameras.

This comes from the application.

◆ Sync()

virtual USDIMAGING_API void Sync ( HdSyncRequestVector request)
overridevirtual

Synchronizes the delegate state for the given request vector.

Reimplemented from HdSceneDelegate.

Friends And Related Function Documentation

◆ UsdImagingIndexProxy

friend class UsdImagingIndexProxy
friend

Definition at line 512 of file delegate.h.

◆ UsdImagingPrimAdapter

friend class UsdImagingPrimAdapter
friend

Definition at line 513 of file delegate.h.

Member Data Documentation

◆ ALL_INSTANCES

constexpr int ALL_INSTANCES = -1
staticconstexpr

Populate HdxSelection for given path (root) and instanceIndex.

If indexPath is an instancer and instanceIndex is ALL_INSTANCES (-1), all instances will be selected.

Note: if usdPath points to a gprim, "instanceIndex" (if provided) is assumed to be the hydra-computed instance index returned from picking code.

If usdPath points to a point instancer, "instanceIndex" is assumed to be the instance of the point instancer to selection highlight (e.g. instance N of the protoIndices array). This would correspond to returning one of the tuples from GetScenePrimPath's "instancerContext".

In any other case, the interpretation of instanceIndex is undefined.

Definition at line 491 of file delegate.h.


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