Loading...
Searching...
No Matches
HdInstanceSchema Class Reference

This schema can be considered the opposite of instancerTopology's "instanceLocations". More...

#include <instanceSchema.h>

+ Inheritance diagram for HdInstanceSchema:

Classes

class  Builder
 Utility class for setting sparse sets of child data source fields to be filled as arguments into BuildRetained. More...
 

Public Member Functions

Member accessor
HD_API HdPathDataSourceHandle GetInstancer () const
 Path to instancer for which a (sub-)entry was added to its instancerTopology's instanceIndices during instance aggregation to account for this instance.
 
HD_API HdIntDataSourceHandle GetPrototypeIndex () const
 Index into vector data source at instancer's instancerTopology's instanceIndices to find entry corresponding to this instance.
 
HD_API HdIntDataSourceHandle GetInstanceIndex () const
 Index into int array within the vector data source at instancer's instancerTopology's instanceIndices to find entry corresponding to this instance.
 
- Public Member Functions inherited from HdSchema
 HdSchema (HdContainerDataSourceHandle container)
 
HD_API HdContainerDataSourceHandle GetContainer () const
 Returns the container data source that this schema is interpreting.
 
HD_API bool IsDefined () const
 
 operator bool () const
 Returns true if this schema is applied on top of a non-null container.
 

Static Public Member Functions

Schema location
static HD_API const TfTokenGetSchemaToken ()
 Returns a token where the container representing this schema is found in a container by default.
 
static HD_API const HdDataSourceLocatorGetDefaultLocator ()
 Returns an HdDataSourceLocator (relative to the prim-level data source) where the container representing this schema is found by default.
 
Schema construction
static HD_API HdContainerDataSourceHandle BuildRetained (const HdPathDataSourceHandle &instancer, const HdIntDataSourceHandle &prototypeIndex, const HdIntDataSourceHandle &instanceIndex)
 

Schema retrieval

 HdInstanceSchema (HdContainerDataSourceHandle container)
 
static HD_API HdInstanceSchema GetFromParent (const HdContainerDataSourceHandle &fromParentContainer)
 Retrieves a container data source with the schema's default name token "instance" from the parent container and constructs a HdInstanceSchema instance.
 

Additional Inherited Members

- Public Types inherited from HdSchema
using UnderlyingDataSource = HdContainerDataSource
 
- Protected Member Functions inherited from HdSchema
template<typename T >
T::Handle _GetTypedDataSource (TfToken name) const
 Returns a datasource of the requested type for the given name: schema implementations can use this to ask for child containers, sampled values, vectors, etc.
 
- Protected Attributes inherited from HdSchema
HdContainerDataSourceHandle _container
 

Detailed Description

This schema can be considered the opposite of instancerTopology's "instanceLocations".

When the scene coalesces scene prims into multiple instances of a single prototype, it inserts "instance" prims at the site of de-duplication. The instancer prim added to manage the prototype uses "instanceLocations" to point back to all of these instance prims.

The instance prims aren't directly useful for rendering but can be useful for scene processing and data aggregation.

Definition at line 58 of file instanceSchema.h.

Constructor & Destructor Documentation

◆ HdInstanceSchema()

HdInstanceSchema ( HdContainerDataSourceHandle  container)
inline

Definition at line 64 of file instanceSchema.h.

Member Function Documentation

◆ BuildRetained()

static HD_API HdContainerDataSourceHandle BuildRetained ( const HdPathDataSourceHandle &  instancer,
const HdIntDataSourceHandle &  prototypeIndex,
const HdIntDataSourceHandle &  instanceIndex 
)
static
Deprecated:
Use Builder instead.

Builds a container data source which includes the provided child data sources. Parameters with nullptr values are excluded. This is a low-level interface. For cases in which it's desired to define the container with a sparse set of child fields, the Builder class is often more convenient and readable.

◆ GetDefaultLocator()

static HD_API const HdDataSourceLocator & GetDefaultLocator ( )
static

Returns an HdDataSourceLocator (relative to the prim-level data source) where the container representing this schema is found by default.

◆ GetFromParent()

static HD_API HdInstanceSchema GetFromParent ( const HdContainerDataSourceHandle &  fromParentContainer)
static

Retrieves a container data source with the schema's default name token "instance" from the parent container and constructs a HdInstanceSchema instance.

Because the requested container data source may not exist, the result should be checked with IsDefined() or a bool comparison before use.

◆ GetInstanceIndex()

HD_API HdIntDataSourceHandle GetInstanceIndex ( ) const

Index into int array within the vector data source at instancer's instancerTopology's instanceIndices to find entry corresponding to this instance.

◆ GetInstancer()

HD_API HdPathDataSourceHandle GetInstancer ( ) const

Path to instancer for which a (sub-)entry was added to its instancerTopology's instanceIndices during instance aggregation to account for this instance.

Note that instanceIndices is nested, that is a vector data source containing integer arrays, one for each prototype the instancer is instancing. Thus, we need two indices to identify the entry: prototypeIndex is the outer index and instanceIndex the inner index.

◆ GetPrototypeIndex()

HD_API HdIntDataSourceHandle GetPrototypeIndex ( ) const

Index into vector data source at instancer's instancerTopology's instanceIndices to find entry corresponding to this instance.

◆ GetSchemaToken()

static HD_API const TfToken & GetSchemaToken ( )
static

Returns a token where the container representing this schema is found in a container by default.


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