MaterialX 1.38.9
Loading...
Searching...
No Matches
ShaderMetadataRegistry Class Reference

A registry for metadata that will be exported to the generated shader if found on nodes and inputs during shader generation. More...

#include <ShaderNode.h>

Inheritance diagram for ShaderMetadataRegistry:
GenUserData

Public Member Functions

void addMetadata (const string &name, const TypeDesc *type, ValuePtr value=nullptr)
 Add a new metadata entry to the registry. More...
 
const ShaderMetadatafindMetadata (const string &name) const
 Return the metadata registered for the given name, or nullptr if no such entry is found.
 
ShaderMetadatafindMetadata (const string &name)
 Return the metadata registered for the given name, or nullptr if no such entry is found.
 
const ShaderMetadataVec & getAllMetadata () const
 Return all entries in the registry.
 
void clear ()
 Clear all entries in the registry.
 
- Public Member Functions inherited from GenUserData
GenUserDataPtr getSelf ()
 Return a shared pointer for this object.
 
ConstGenUserDataPtr getSelf () const
 Return a shared pointer for this object.
 
template<class T >
shared_ptr< T > asA ()
 Return this object cast to a templated type.
 
template<class T >
shared_ptr< const T > asA () const
 Return this object cast to a templated type.
 

Static Public Attributes

static const string USER_DATA_NAME = "ShaderMetadataRegistry"
 

Protected Attributes

vector< ShaderMetadata_entries
 
std::unordered_map< string, size_t > _entryIndex
 

Detailed Description

A registry for metadata that will be exported to the generated shader if found on nodes and inputs during shader generation.

Member Function Documentation

◆ addMetadata()

void addMetadata ( const string &  name,
const TypeDesc type,
ValuePtr  value = nullptr 
)
inline

Add a new metadata entry to the registry.

The entry contains the name and data type for the metadata.


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