HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_ShaderTranslatorRegistry Class Reference

#include <HUSD_ShaderTranslator.h>

Public Member Functions

void registerShaderTranslator (HUSD_ShaderTranslator &translator)
 Adds the translator to the list of known translators. More...
 
void unregisterShaderTranslator (HUSD_ShaderTranslator &translator)
 Removes the translator from the list of known translators. More...
 
HUSD_ShaderTranslatorfindShaderTranslator (const OP_Node &node) const
 
int findShaderTranslatorID (const OP_Node &node) const
 
void registerPreviewShaderGenerator (HUSD_PreviewShaderGenerator &g)
 Adds the generator to the list of known generator. More...
 
void unregisterPreviewShaderGenerator (HUSD_PreviewShaderGenerator &g)
 Removes the generator from the list of known generator. More...
 
HUSD_PreviewShaderGeneratorfindPreviewShaderGenerator (const OP_Node &node) const
 
void clear ()
 
void reportShaderTranslation (const OP_Node &node, const UT_StringRef &usd_shader_path)
 Informs the registry about a new translation of node into a USD prim. More...
 

Static Public Member Functions

static
HUSD_ShaderTranslatorRegistry
get ()
 Returns a singelton instance. More...
 
using TranslationRecord = std::pair< int, UT_StringHolder >
 
using TranslationRecords = UT_Array< TranslationRecord >
 
void addTranslationObserver (const OP_Node &node)
 
TranslationRecords removeTranslationObserver (const OP_Node &node)
 

Detailed Description

Keeps a list of known translators that define a USD shader prim from Houdini shader nodes.

Definition at line 172 of file HUSD_ShaderTranslator.h.

Member Typedef Documentation

Adds and removes a node from the translation observers list. Observers are basicaly interested in creation of any new USD shader primitive and the original VOP node based on which it was created. Translators report such creation events with reportShaderTranslation(), and observer LOPs can use that info to selectively re-translate single USD prim when a only single VOP changed.

Definition at line 219 of file HUSD_ShaderTranslator.h.

Adds and removes a node from the translation observers list. Observers are basicaly interested in creation of any new USD shader primitive and the original VOP node based on which it was created. Translators report such creation events with reportShaderTranslation(), and observer LOPs can use that info to selectively re-translate single USD prim when a only single VOP changed.

Definition at line 220 of file HUSD_ShaderTranslator.h.

Member Function Documentation

void HUSD_ShaderTranslatorRegistry::addTranslationObserver ( const OP_Node node)

Adds and removes a node from the translation observers list. Observers are basicaly interested in creation of any new USD shader primitive and the original VOP node based on which it was created. Translators report such creation events with reportShaderTranslation(), and observer LOPs can use that info to selectively re-translate single USD prim when a only single VOP changed.

void HUSD_ShaderTranslatorRegistry::clear ( )

Removes all translators and generators from the registry. Should only be called on shutdown of the process.

HUSD_PreviewShaderGenerator* HUSD_ShaderTranslatorRegistry::findPreviewShaderGenerator ( const OP_Node node) const

Returns a generator that accepts the given render target mask. If no generator is found, returns nullptr.

HUSD_ShaderTranslator* HUSD_ShaderTranslatorRegistry::findShaderTranslator ( const OP_Node node) const

Returns a translator that accepts the given render target mask. If no translator is found, returns nullptr.

int HUSD_ShaderTranslatorRegistry::findShaderTranslatorID ( const OP_Node node) const

Returns the internal ID number of a translator that handles the translation of the given node.

static HUSD_ShaderTranslatorRegistry& HUSD_ShaderTranslatorRegistry::get ( )
static

Returns a singelton instance.

void HUSD_ShaderTranslatorRegistry::registerPreviewShaderGenerator ( HUSD_PreviewShaderGenerator g)

Adds the generator to the list of known generator.

void HUSD_ShaderTranslatorRegistry::registerShaderTranslator ( HUSD_ShaderTranslator translator)

Adds the translator to the list of known translators.

TranslationRecords HUSD_ShaderTranslatorRegistry::removeTranslationObserver ( const OP_Node node)

Adds and removes a node from the translation observers list. Observers are basicaly interested in creation of any new USD shader primitive and the original VOP node based on which it was created. Translators report such creation events with reportShaderTranslation(), and observer LOPs can use that info to selectively re-translate single USD prim when a only single VOP changed.

void HUSD_ShaderTranslatorRegistry::reportShaderTranslation ( const OP_Node node,
const UT_StringRef usd_shader_path 
)

Informs the registry about a new translation of node into a USD prim.

void HUSD_ShaderTranslatorRegistry::unregisterPreviewShaderGenerator ( HUSD_PreviewShaderGenerator g)

Removes the generator from the list of known generator.

void HUSD_ShaderTranslatorRegistry::unregisterShaderTranslator ( HUSD_ShaderTranslator translator)

Removes the translator from the list of known translators.


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