All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdImagingDelegate Class Reference

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

+ 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. More...
 
USDIMAGING_API void SyncAll (bool includeUnvarying)
 
virtual USDIMAGING_API void PostSyncCleanup () override
 Opportunity for the delegate to clean itself up after performing parallel work during sync phase. More...
 
USDIMAGING_API void Populate (UsdPrim const &rootPrim)
 Populates the rootPrim in the HdRenderIndex. More...
 
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. More...
 
USDIMAGING_API void SetTime (UsdTimeCode time)
 Sets the current time from which data will be read by the delegate. More...
 
UsdTimeCode GetTime () const
 Returns the current time. More...
 
UsdTimeCode GetTimeWithOffset (float offset) const
 Apply a relative offset to the current time. More...
 
USDIMAGING_API void ApplyPendingUpdates ()
 Applies any scene edits which have been queued up by notices from USD. More...
 
int GetRefineLevelFallback () const
 Returns the refinement level that is used when prims have no explicit level set. More...
 
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. More...
 
USDIMAGING_API void ClearRefineLevel (SdfPath const &usdPath)
 Removes any explicit refine level set for the given USD prim. More...
 
USDIMAGING_API void SetRefineLevel (SdfPath const &usdPath, int level)
 Sets an explicit refinement level for the given USD prim. More...
 
HdReprSelector GetReprFallback () const
 Returns the fallback repr name. More...
 
USDIMAGING_API void SetReprFallback (HdReprSelector const &repr)
 Sets the fallback repr name. More...
 
HdCullStyle GetCullStyleFallback () const
 Returns the fallback cull style. More...
 
USDIMAGING_API void SetCullStyleFallback (HdCullStyle cullStyle)
 Sets the fallback cull style. More...
 
USDIMAGING_API void SetRootTransform (GfMatrix4d const &xf)
 Sets the root transform for the entire delegate, which is applied to all render prims generated. More...
 
const GfMatrix4dGetRootTransform () const
 Returns the root transform for the entire delegate. More...
 
USDIMAGING_API void SetRootVisibility (bool isVisible)
 Sets the root visibility for the entire delegate, which is applied to all render prims generated. More...
 
bool GetRootVisibility () const
 Returns the root visibility for the entire delegate. More...
 
USDIMAGING_API void SetInvisedPrimPaths (SdfPathVector const &invisedPaths)
 Set the list of paths that must be invised. More...
 
USDIMAGING_API void SetRigidXformOverrides (RigidXformOverridesMap const &overrides)
 Set transform value overrides on a set of paths. More...
 
USDIMAGING_API PickabilityMap GetPickabilityMap () const
 Returns the root paths of pickable objects. More...
 
USDIMAGING_API void SetPickability (SdfPath const &path, bool pickable)
 Sets pickability for a specific path. More...
 
USDIMAGING_API void ClearPickabilityMap ()
 Clears any pickability opinions that this delegates might have. More...
 
USDIMAGING_API void SetDisplayRender (const bool displayRender)
 Sets display of prims with purpose "render". More...
 
bool GetDisplayRender () const
 
USDIMAGING_API void SetDisplayProxy (const bool displayProxy)
 Sets display of prims with purpose "proxy". More...
 
bool GetDisplayProxy () const
 
USDIMAGING_API void SetDisplayGuides (const bool displayGuides)
 Sets display of prims with purpose "guide". More...
 
bool GetDisplayGuides () const
 
USDIMAGING_API void SetUsdDrawModesEnabled (bool enableUsdDrawModes)
 Returns whether draw modes are enabled. More...
 
bool GetUsdDrawModesEnabled () const
 
USDIMAGING_API void SetSceneMaterialsEnabled (bool enable)
 Enables custom shading on prims. More...
 
USDIMAGING_API void SetSceneLightsEnabled (bool enable)
 Enables lights found in the usdscene. More...
 
USDIMAGING_API void SetWindowPolicy (CameraUtilConformWindowPolicy policy)
 Set the window policy on all scene cameras. More...
 
USDIMAGING_API void SetDisplayUnloadedPrimsWithBounds (bool displayUnloaded)
 Sets display of unloaded prims as bounding boxes. More...
 
bool GetDisplayUnloadedPrimsWithBounds () const
 
USDIMAGING_API void SetCameraForSampling (SdfPath const &id)
 Setup for the shutter open and close to be used for motion sampling. More...
 
USDIMAGING_API GfInterval GetCurrentTimeSamplingInterval ()
 Returns the current interval that will be used when using the sample* API in the scene delegate. More...
 
virtual USDIMAGING_API TfToken GetRenderTag (SdfPath const &id) override
 Returns the render tag that will be used to bucket prims during render pass bucketing. More...
 
virtual USDIMAGING_API
HdMeshTopology 
GetMeshTopology (SdfPath const &id) override
 Gets the topological mesh data for a given prim. More...
 
virtual USDIMAGING_API
HdBasisCurvesTopology 
GetBasisCurvesTopology (SdfPath const &id) override
 Gets the topological curve data for a given prim. More...
 
virtual USDIMAGING_API SubdivTags GetSubdivTags (SdfPath const &id) override
 Gets the subdivision surface tags (sharpness, holes, etc). More...
 
virtual USDIMAGING_API GfRange3d GetExtent (SdfPath const &id) override
 Gets the axis aligned bounds of a prim. More...
 
virtual USDIMAGING_API GfMatrix4d GetTransform (SdfPath const &id) override
 Returns the object space transform, including all parent transforms. More...
 
virtual USDIMAGING_API bool GetVisible (SdfPath const &id) override
 Returns the authored visible state of the prim. More...
 
virtual USDIMAGING_API bool GetDoubleSided (SdfPath const &id) override
 Returns the doubleSided state for the given prim. More...
 
virtual USDIMAGING_API HdCullStyle GetCullStyle (SdfPath const &id) override
 Returns the cullstyle for the given prim. More...
 
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(). More...
 
virtual USDIMAGING_API VtValue Get (SdfPath const &id, TfToken const &key) override
 Returns a named value. More...
 
virtual USDIMAGING_API VtValue GetIndexedPrimvar (SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
 Returns a named primvar value. More...
 
USDIMAGING_API virtual
HdIdVectorSharedPtr 
GetCoordSysBindings (SdfPath const &id) override
 Returns the coordinate system bindings, or a nullptr if none are bound. More...
 
virtual USDIMAGING_API
HdReprSelector 
GetReprSelector (SdfPath const &id) override
 Returns the authored repr (if any) for the given prim. More...
 
virtual USDIMAGING_API VtArray
< TfToken
GetCategories (SdfPath const &id) override
 Returns the prim categories. More...
 
virtual USDIMAGING_API
std::vector< VtArray< TfToken > > 
GetInstanceCategories (SdfPath const &instancerId) override
 Returns the categories for all instances in the instancer. More...
 
virtual USDIMAGING_API
HdPrimvarDescriptorVector 
GetPrimvarDescriptors (SdfPath const &id, HdInterpolation interpolation) override
 Returns descriptors for all primvars of the given interpolation type. More...
 
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. More...
 
virtual USDIMAGING_API GfMatrix4d GetInstancerTransform (SdfPath const &instancerId) override
 Returns the instancer transform. More...
 
virtual USDIMAGING_API SdfPath GetInstancerId (SdfPath const &primId) override
 Returns the parent instancer of the given rprim or instancer. More...
 
virtual USDIMAGING_API
SdfPathVector 
GetInstancerPrototypes (SdfPath const &instancerId) override
 Returns a list of prototypes of this instancer. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual USDIMAGING_API SdfPath GetMaterialId (SdfPath const &rprimId) override
 Returns the material ID bound to the rprim rprimId. More...
 
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. More...
 
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. More...
 
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. More...
 
USDIMAGING_API
HdExtComputationInputDescriptorVector 
GetExtComputationInputDescriptors (SdfPath const &computationId) override
 For the given computation id, returns a list of computation input descriptors. More...
 
USDIMAGING_API
HdExtComputationOutputDescriptorVector 
GetExtComputationOutputDescriptors (SdfPath const &computationId) override
 For the given computation id, returns a list of computation output descriptors. More...
 
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. More...
 
USDIMAGING_API VtValue GetExtComputationInput (SdfPath const &computationId, TfToken const &input) override
 Returns a single value for a given computation id and input token. More...
 
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. More...
 
USDIMAGING_API std::string GetExtComputationKernel (SdfPath const &computationId) override
 Returns the kernel source assigned to the computation at the path id. More...
 
USDIMAGING_API void InvokeExtComputation (SdfPath const &computationId, HdExtComputationContext *context) override
 Requests the scene delegate run the ExtComputation with the given id. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from HdSceneDelegate
HD_API HdSceneDelegate (HdRenderIndex *parentIndex, SdfPath const &delegateID)
 Constructor used for nested delegate objects which share a RenderIndex. More...
 
HdRenderIndexGetRenderIndex ()
 Returns the RenderIndex owned by this delegate. More...
 
SdfPath const & GetDelegateID () const
 Returns the ID of this delegate, which is used as a prefix for all objects it creates in the RenderIndex. More...
 
virtual HD_API bool IsEnabled (TfToken const &option) const
 Returns true if the named option is enabled by the delegate. More...
 
virtual HD_API VtValue GetShadingStyle (SdfPath const &id)
 Returns the shading style for the given prim. More...
 
template<unsigned int CAPACITY>
void SampleTransform (SdfPath const &id, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleTransform() that takes an HdTimeSampleArray. More...
 
template<unsigned int CAPACITY>
void SampleInstancerTransform (SdfPath const &instancerId, HdTimeSampleArray< GfMatrix4d, CAPACITY > *sa)
 Convenience form of SampleInstancerTransform() that takes an HdTimeSampleArray. More...
 
template<unsigned int CAPACITY>
void SamplePrimvar (SdfPath const &id, TfToken const &key, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SamplePrimvar() that takes an HdTimeSampleArray. More...
 
template<unsigned int CAPACITY>
void SampleIndexedPrimvar (SdfPath const &id, TfToken const &key, HdIndexedTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleIndexedPrimvar() that takes HdTimeSampleArrays. More...
 
virtual HD_API
HdRenderBufferDescriptor 
GetRenderBufferDescriptor (SdfPath const &id)
 Returns the allocation descriptor for a given render buffer prim. More...
 
template<unsigned int CAPACITY>
void SampleExtComputationInput (SdfPath const &computationId, TfToken const &input, HdTimeSampleArray< VtValue, CAPACITY > *sa)
 Convenience form of SampleExtComputationInput() that takes an HdTimeSampleArray. More...
 
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. More...
 

Static Public Attributes

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

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 87 of file delegate.h.

Member Function Documentation

USDIMAGING_API void ApplyPendingUpdates ( )

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

USDIMAGING_API void ClearPickabilityMap ( )

Clears any pickability opinions that this delegates might have.

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.

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 482 of file delegate.h.

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

Returns a named value.

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API HdBasisCurvesTopology GetBasisCurvesTopology ( SdfPath const &  id)
overridevirtual

Gets the topological curve data for a given prim.

Reimplemented from HdSceneDelegate.

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.

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

Returns the prim categories.

Reimplemented from HdSceneDelegate.

USDIMAGING_API virtual HdIdVectorSharedPtr GetCoordSysBindings ( SdfPath const &  id)
overridevirtual

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

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API HdCullStyle GetCullStyle ( SdfPath const &  id)
overridevirtual

Returns the cullstyle for the given prim.

Reimplemented from HdSceneDelegate.

HdCullStyle GetCullStyleFallback ( ) const
inline

Returns the fallback cull style.

Definition at line 193 of file delegate.h.

USDIMAGING_API GfInterval GetCurrentTimeSamplingInterval ( )

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

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.

virtual USDIMAGING_API bool GetDoubleSided ( SdfPath const &  id)
overridevirtual

Returns the doubleSided state for the given prim.

Reimplemented from HdSceneDelegate.

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.

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.

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.

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.

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.

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.

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.

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.

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

Returns the categories for all instances in the instancer.

Reimplemented from HdSceneDelegate.

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.

virtual USDIMAGING_API SdfPath GetInstancerId ( SdfPath const &  primId)
overridevirtual

Returns the parent instancer of the given rprim or instancer.

Reimplemented from HdSceneDelegate.

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.

virtual USDIMAGING_API GfMatrix4d GetInstancerTransform ( SdfPath const &  instancerId)
overridevirtual

Returns the instancer transform.

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API SdfPath GetMaterialId ( SdfPath const &  rprimId)
overridevirtual

Returns the material ID bound to the rprim rprimId.

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API HdMeshTopology GetMeshTopology ( SdfPath const &  id)
overridevirtual

Gets the topological mesh data for a given prim.

Reimplemented from HdSceneDelegate.

USDIMAGING_API PickabilityMap GetPickabilityMap ( ) const

Returns the root paths of pickable objects.

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

Returns descriptors for all primvars of the given interpolation type.

Reimplemented from HdSceneDelegate.

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 160 of file delegate.h.

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.

HdReprSelector GetReprFallback ( ) const
inline

Returns the fallback repr name.

Definition at line 185 of file delegate.h.

virtual USDIMAGING_API HdReprSelector GetReprSelector ( SdfPath const &  id)
overridevirtual

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

Reimplemented from HdSceneDelegate.

const GfMatrix4d& GetRootTransform ( ) const
inline

Returns the root transform for the entire delegate.

Definition at line 206 of file delegate.h.

bool GetRootVisibility ( ) const
inline

Returns the root visibility for the entire delegate.

Definition at line 215 of file delegate.h.

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.

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API SubdivTags GetSubdivTags ( SdfPath const &  id)
overridevirtual

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

Reimplemented from HdSceneDelegate.

UsdTimeCode GetTime ( ) const
inline

Returns the current time.

Definition at line 143 of file delegate.h.

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.

virtual USDIMAGING_API GfMatrix4d GetTransform ( SdfPath const &  id)
overridevirtual

Returns the object space transform, including all parent transforms.

Reimplemented from HdSceneDelegate.

virtual USDIMAGING_API bool GetVisible ( SdfPath const &  id)
overridevirtual

Returns the authored visible state of the prim.

Reimplemented from HdSceneDelegate.

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.

USDIMAGING_API bool IsInInvisedPaths ( const SdfPath usdPath) const

Returns true if usdPath is included in invised path list.

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.

virtual USDIMAGING_API void PostSyncCleanup ( )
overridevirtual

Opportunity for the delegate to clean itself up after performing parallel work during sync phase.

Reimplemented from HdSceneDelegate.

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.

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.

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.

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.

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.

USDIMAGING_API void SetCameraForSampling ( SdfPath const &  id)

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

USDIMAGING_API void SetCullStyleFallback ( HdCullStyle  cullStyle)

Sets the fallback cull style.

USDIMAGING_API void SetDisplayGuides ( const bool  displayGuides)

Sets display of prims with purpose "guide".

USDIMAGING_API void SetDisplayProxy ( const bool  displayProxy)

Sets display of prims with purpose "proxy".

USDIMAGING_API void SetDisplayRender ( const bool  displayRender)

Sets display of prims with purpose "render".

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()).
USDIMAGING_API void SetInvisedPrimPaths ( SdfPathVector const &  invisedPaths)

Set the list of paths that must be invised.

USDIMAGING_API void SetPickability ( SdfPath const &  path,
bool  pickable 
)

Sets pickability for a specific path.

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.

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.

USDIMAGING_API void SetReprFallback ( HdReprSelector const &  repr)

Sets the fallback repr name.

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

USDIMAGING_API void SetRigidXformOverrides ( RigidXformOverridesMap const &  overrides)

Set transform value overrides on a set of paths.

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.

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.

USDIMAGING_API void SetSceneLightsEnabled ( bool  enable)

Enables lights found in the usdscene.

USDIMAGING_API void SetSceneMaterialsEnabled ( bool  enable)

Enables custom shading on prims.

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.

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.

USDIMAGING_API void SetUsdDrawModesEnabled ( bool  enableUsdDrawModes)

Returns whether draw modes are enabled.

USDIMAGING_API void SetWindowPolicy ( CameraUtilConformWindowPolicy  policy)

Set the window policy on all scene cameras.

This comes from the application.

virtual USDIMAGING_API void Sync ( HdSyncRequestVector request)
overridevirtual

Synchronizes the delegate state for the given request vector.

Reimplemented from HdSceneDelegate.

Member Data Documentation

constexpr int ALL_INSTANCES = -1
static

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 511 of file delegate.h.


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