![]() |
|
A schema marking a prim as instanced by another prim. More...
#include <instancedBySchema.h>
Inheritance diagram for HdInstancedBySchema: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 HdPathArrayDataSourceHandle | GetPaths () const |
| HD_API HdPathArrayDataSourceHandle | GetPrototypeRoots () const |
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 TfToken & | GetSchemaToken () |
| Returns a token where the container representing this schema is found in a container by default. | |
| static HD_API const HdDataSourceLocator & | GetDefaultLocator () |
| Returns an HdDataSourceLocator (relative to the prim-level data source) where the container representing this schema is found by default. | |
Data source locators for members | |
The following methods return an HdDataSourceLocator (relative to the prim-level data source) where the data source for a member can be found. This is often useful for checking intersection against the HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied. | |
| static HD_API const HdDataSourceLocator & | GetPathsLocator () |
| Prim-level relative data source locator to locate paths. | |
Schema construction | |
| static HD_API HdContainerDataSourceHandle | BuildRetained (const HdPathArrayDataSourceHandle &paths, const HdPathArrayDataSourceHandle &prototypeRoots) |
Schema retrieval | |
| HdInstancedBySchema (HdContainerDataSourceHandle container) | |
| static HD_API HdInstancedBySchema | GetFromParent (const HdContainerDataSourceHandle &fromParentContainer) |
| Retrieves a container data source with the schema's default name token "instancedBy" from the parent container and constructs a HdInstancedBySchema 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 |
A schema marking a prim as instanced by another prim.
Many renderers need to know not what prototypes an instancer has, but rather what instancers a prototype has; this is encoded in "instancedBy". A prim is "instancedBy" /Instancer if /Instancer has a prototype path that's a parent of the prim. A complicating exception is if /A instances /A/B, which instances /A/B/C, we don't consider /A to be instancing /A/B/C directly; this is to support nested explicit instancing of things like leaves/trees/forests.
This value is computed based on the instancer topology of instancer prims in the scene.
Note: if multiple instancers reference a prototype, it's possible for instancedBy to contain multiple entries. Some renderers may be able to read this directly, but some may need to duplicate prims with an op so that each prim has a single instancer, depending on how the renderer exposes instancing.
Definition at line 67 of file instancedBySchema.h.
|
inline |
Definition at line 73 of file instancedBySchema.h.
|
static |
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.
|
static |
Returns an HdDataSourceLocator (relative to the prim-level data source) where the container representing this schema is found by default.
|
static |
Retrieves a container data source with the schema's default name token "instancedBy" from the parent container and constructs a HdInstancedBySchema instance.
Because the requested container data source may not exist, the result should be checked with IsDefined() or a bool comparison before use.
|
static |
Prim-level relative data source locator to locate paths.
|
static |
Returns a token where the container representing this schema is found in a container by default.