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

#include <HUSD_KarmaShaderTranslator.h>

+ Inheritance diagram for HUSD_KarmaShaderTranslator:

Public Member Functions

bool matchesRenderMask (const UT_StringRef &render_mask) override
 
void createMaterialShader (HUSD_AutoWriteLock &lock, const UT_StringRef &usd_material_path, const HUSD_TimeCode &time_code, OP_Node &shader_node, VOP_Type shader_type, const UT_StringRef &output_name) override
 
UT_StringHolder createShader (HUSD_AutoWriteLock &lock, const UT_StringRef &usd_material_path, const UT_StringRef &usd_parent_path, const HUSD_TimeCode &time_code, OP_Node &shader_node, const UT_StringRef &output_name) override
 
void updateShaderParameters (HUSD_AutoWriteLock &lock, const UT_StringRef &usd_shader_path, const HUSD_TimeCode &time_code, OP_Node &shader_node, const UT_StringArray &parameter_names) override
 
UT_StringHolder getRenderContextName (OP_Node &shader_node, const UT_StringRef &output_name) override
 
- Public Member Functions inherited from HUSD_ShaderTranslator
virtual ~HUSD_ShaderTranslator ()=default
 Standard virtual destructor for this abstract base class. More...
 
virtual void setID (int id)
 Some translators may want to know their ID in the registry. More...
 
virtual int getID () const
 

Detailed Description

Definition at line 25 of file HUSD_KarmaShaderTranslator.h.

Member Function Documentation

void HUSD_KarmaShaderTranslator::createMaterialShader ( HUSD_AutoWriteLock lock,
const UT_StringRef usd_material_path,
const HUSD_TimeCode time_code,
OP_Node shader_node,
VOP_Type  shader_type,
const UT_StringRef output_name 
)
overridevirtual

Defines a USD shader primitive that is part of the USD material. Ie, the translator will connect the shader to the material output.

usd_material_path - path to the material primitive in which the shader primitive should be created. time_code - time code at which to evaluate any properties shader_node - the Houdini node that represents a shader and that needs to be translated into a USD shader primitive shader_type - some VOPs contains several shaders (eg material builders). So this parameters specifies the type of the shader to pick and translate. output_name - the output name of the VOP node that represents the shader to pick and translate. It can be an empty string, if the VOP node does not have shader outputs.

Implements HUSD_ShaderTranslator.

UT_StringHolder HUSD_KarmaShaderTranslator::createShader ( HUSD_AutoWriteLock lock,
const UT_StringRef usd_material_path,
const UT_StringRef usd_parent_path,
const HUSD_TimeCode time_code,
OP_Node shader_node,
const UT_StringRef output_name 
)
overridevirtual

Defines a USD shader primitive that is part of a shader network chain. Ie, the translator will create a shader primitive output, that the caller can use to connect as an input to another shader.

usd_material_path - path to the material primitive in which the shader primitive should be created. usd_parent_path - path to the primitive inside which the shader primitive should be created directly. time_code - time code at which to evaluate any properties shader_node - the Houdini node that represents a shader and that needs to be translated into a USD shader primitive output_name - the output name of the VOP node that needs to be translated into USD shader output. This is the output the caller is interested in having representation in USD.

Returns
The path to the USD shader output attribute corresponding to the output_name connector on the shader_node.

Implements HUSD_ShaderTranslator.

UT_StringHolder HUSD_KarmaShaderTranslator::getRenderContextName ( OP_Node shader_node,
const UT_StringRef output_name 
)
overridevirtual

Returns the name of the renderer (render context name) that should be used in the material output name for that USD shader.

Implements HUSD_ShaderTranslator.

bool HUSD_KarmaShaderTranslator::matchesRenderMask ( const UT_StringRef render_mask)
overridevirtual

Returns true if the translator can encode a shader that reports a given render mask (ie, is a shader for a given render target).

Implements HUSD_ShaderTranslator.

void HUSD_KarmaShaderTranslator::updateShaderParameters ( HUSD_AutoWriteLock lock,
const UT_StringRef usd_shader_path,
const HUSD_TimeCode time_code,
OP_Node shader_node,
const UT_StringArray parameter_names 
)
overridevirtual

Re-translates the shader parameters given the shader VOP node (and its new parameter values). usd_shader_path - the path to the USD shader primitive whose input attributes need updating due to node parm value change. time_code - time code at which to evaluate any properties shader_node - Houdini node that represents a shader that needs to be re-translated into the given USD shader primitive. parameter_names - the list of parameters that have changed. If the list is empty, then any of the node's parameters may have changed. If it's not empty, then only listed parameters have changed.

Implements HUSD_ShaderTranslator.


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