Loading...
Searching...
No Matches
HdMaterialNodeSchema Class Reference

The MaterialNode schema is a container schema that defines a particular node in a material network. More...

#include <materialNodeSchema.h>

+ Inheritance diagram for HdMaterialNodeSchema:

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

Schema retrieval
 HdMaterialNodeSchema (HdContainerDataSourceHandle container)
 
Member accessor
HD_API HdMaterialNodeParameterContainerSchema GetParameters () const
 Maps parameter names to node parameters.
 
HD_API HdMaterialConnectionVectorContainerSchema GetInputConnections () const
 Maps input names to vectors of connections.
 
HD_API HdTokenDataSourceHandle GetNodeIdentifier () const
 This identifies the shader the node represents.
 
HD_API HdContainerDataSourceHandle GetRenderContextNodeIdentifiers () const
 A shading node can hold a nodeIdentifier value for multiple render contexts at once.
 
HD_API HdContainerDataSourceHandle GetNodeTypeInfo () const
 Rather than having an identifier, a shader can be specified by other information.
 
- 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 construction
static HD_API HdContainerDataSourceHandle BuildRetained (const HdContainerDataSourceHandle &parameters, const HdContainerDataSourceHandle &inputConnections, const HdTokenDataSourceHandle &nodeIdentifier, const HdContainerDataSourceHandle &renderContextNodeIdentifiers, const HdContainerDataSourceHandle &nodeTypeInfo)
 

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

The MaterialNode schema is a container schema that defines a particular node in a material network.

A material node defines its connections to other nodes via the "inputConnections" member. For example, "albedo" would define that it receives its value from its connection to the node "Color_UnPreMult" and the output "resultRGB" with the following data sources:

ds at: material/<renderContext>/nodes/MaterialLayer/inputConnections /albedo/[0]/upstreamNodePath = Color_UnPreMult

ds at: material/<renderContext>/nodes/MaterialLayer/inputConnections /albedo/[0]/upstreamNodeOutputName = resultRGB

Definition at line 65 of file materialNodeSchema.h.

Constructor & Destructor Documentation

◆ HdMaterialNodeSchema()

HdMaterialNodeSchema ( HdContainerDataSourceHandle  container)
inline

Definition at line 71 of file materialNodeSchema.h.

Member Function Documentation

◆ BuildRetained()

static HD_API HdContainerDataSourceHandle BuildRetained ( const HdContainerDataSourceHandle &  parameters,
const HdContainerDataSourceHandle &  inputConnections,
const HdTokenDataSourceHandle &  nodeIdentifier,
const HdContainerDataSourceHandle &  renderContextNodeIdentifiers,
const HdContainerDataSourceHandle &  nodeTypeInfo 
)
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.

◆ GetInputConnections()

HD_API HdMaterialConnectionVectorContainerSchema GetInputConnections ( ) const

Maps input names to vectors of connections.

Each connection is defined by the MaterialConnection schema. Note that inputConnections are inputs that get their value from data flow over the connection.

◆ GetNodeIdentifier()

HD_API HdTokenDataSourceHandle GetNodeIdentifier ( ) const

This identifies the shader the node represents.

The renderContextNodeIdentifier container can store alternative values for this. A consumer which is interested in a specific render context should check for that token within renderContextNodeIdentifiers and fall back on this value in its absence.

◆ GetNodeTypeInfo()

HD_API HdContainerDataSourceHandle GetNodeTypeInfo ( ) const

Rather than having an identifier, a shader can be specified by other information.

◆ GetParameters()

HD_API HdMaterialNodeParameterContainerSchema GetParameters ( ) const

Maps parameter names to node parameters.

Each node parameter is a container that is defined by the MaterialNodeParameter schema. Note that parameters are inputs that supply their value directly.

◆ GetRenderContextNodeIdentifiers()

HD_API HdContainerDataSourceHandle GetRenderContextNodeIdentifiers ( ) const

A shading node can hold a nodeIdentifier value for multiple render contexts at once.

This allows multiple renderer target representations to coexist in the same renderable scene. The contents of this container are alternate possible values for nodeIdentifier. A consumer which is interested in a specific render context should check for that token within this container and fall back on nodeIdentifier in its absence.


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