![]() |
|
The Material schema is a container schema that provides the correct material definition per render context. More...
#include <materialSchema.h>
Inheritance diagram for HdMaterialSchema:Public Member Functions | |
| HD_API TfTokenVector | GetRenderContexts () const |
| The following diagram depicts an example scene index prim "Plastic_Material". | |
| HD_API HdMaterialNetworkSchema | GetMaterialNetwork () const |
| Return the material network schema for the universalRenderContext. | |
| HD_API HdMaterialNetworkSchema | GetMaterialNetwork (TfToken const &renderContext) const |
| Return the material network schema for the given render context. | |
| HD_API HdMaterialNetworkSchema | GetMaterialNetwork (TfTokenVector const &renderContexts) const |
| Return the first material network schema found among the given list of render contexts, falling back to the universal context if none of the provided contexts are found. | |
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 | |
| static HD_API TfToken | GetLocatorTerminal (HdDataSourceLocator const &locator) |
| static HD_API TfToken | GetLocatorTerminal (HdDataSourceLocator const &locator, TfToken const &renderContext) |
| static HD_API TfToken | GetLocatorTerminal (HdDataSourceLocator const &locator, TfTokenVector const &Contexts) |
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. | |
Schema construction | |
| static HD_API HdContainerDataSourceHandle | BuildRetained (size_t count, const TfToken *names, const HdDataSourceBaseHandle *values) |
Schema retrieval | |
| HdMaterialSchema (HdContainerDataSourceHandle container) | |
| static HD_API HdMaterialSchema | GetFromParent (const HdContainerDataSourceHandle &fromParentContainer) |
| Retrieves a container data source with the schema's default name token "material" from the parent container and constructs a HdMaterialSchema 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 |
The Material schema is a container schema that provides the correct material definition per render context.
For example, a material may specify several render contexts like the universalRenderContext (""), Renderman ("ri"), Storm ("glslfx"), etc. Each render context will then provide the specific definition for the renderer, which is defined by the MaterialNetwork schema. The universalRenderContext applies to all renderers.
See "Custom Code: Schema Methods" section for ASCII art diagram.
Definition at line 65 of file materialSchema.h.
|
inline |
Definition at line 71 of file materialSchema.h.
|
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 "material" from the parent container and constructs a HdMaterialSchema instance.
Because the requested container data source may not exist, the result should be checked with IsDefined() or a bool comparison before use.
| HD_API HdMaterialNetworkSchema GetMaterialNetwork | ( | ) | const |
Return the material network schema for the universalRenderContext.
| HD_API HdMaterialNetworkSchema GetMaterialNetwork | ( | TfToken const & | renderContext | ) | const |
Return the material network schema for the given render context.
| HD_API HdMaterialNetworkSchema GetMaterialNetwork | ( | TfTokenVector const & | renderContexts | ) | const |
Return the first material network schema found among the given list of render contexts, falling back to the universal context if none of the provided contexts are found.
| HD_API TfTokenVector GetRenderContexts | ( | ) | const |
The following diagram depicts an example scene index prim "Plastic_Material".
"Plastic_Material" is a scene index prim that has multiple container data sources, like 'material' (HdMaterialSchema) and 'materialOverride' (HdMaterialOverrideSchema). "Plastic_Material" as a scene index prim also has a scene index prim type, which is type 'material'. (See HdPrimTypeTokens). Note the following:
| "Plastic_Material" [scene index prim name] |
|---|
| +--------------------------------—+ +-----------------------------------------------------------------------------------------------------------------------------------------------------—+ |
| +-------------------—+ +--------------------—+ | ||||||
|---|---|---|---|---|---|---|
|
static |
Returns a token where the container representing this schema is found in a container by default.