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 registerPreviewShaderTranslator (HUSD_PreviewShaderTranslator &t)
 Adds the translator to the list of known translators. More...
 
void unregisterPreviewShaderTranslator (HUSD_PreviewShaderTranslator &t)
 Removes the translator from the list of known translators. More...
 
HUSD_PreviewShaderTranslatorfindPreviewShaderTranslator (const UT_StringRef &usd_render_context_name) const
 Returns a translator that accepts the given USD render context name. More...
 
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 194 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 240 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 241 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 from the registry. Should only be called on shutdown of the process.

HUSD_PreviewShaderTranslator* HUSD_ShaderTranslatorRegistry::findPreviewShaderTranslator ( const UT_StringRef usd_render_context_name) const

Returns a translator that accepts the given USD render context name.

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::registerPreviewShaderTranslator ( HUSD_PreviewShaderTranslator t)

Adds the translator to the list of known translators.

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::unregisterPreviewShaderTranslator ( HUSD_PreviewShaderTranslator t)

Removes the translator from the list of known translators.

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: