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

#include <HUSD_VexShaderTranslator.h>

+ Inheritance diagram for HUSD_VexShaderTranslator:

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 UT_StringRef &usd_shader_name, 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
 
void setDependentNodeIDs (const UT_IntArray &node_ids)
 Designates the nodes as shader node dependents, given their IDs. More...
 
const UT_IntArraygetDependentNodeIDs () const
 
virtual void beginMaterialTranslation (HUSD_AutoWriteLock &lock, const UT_StringRef &usd_material_path)
 
virtual void endMaterialTranslation (HUSD_AutoWriteLock &lock, const UT_StringRef &usd_material_path)
 

Detailed Description

Definition at line 25 of file HUSD_VexShaderTranslator.h.

Member Function Documentation

void HUSD_VexShaderTranslator::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_VexShaderTranslator::createShader ( HUSD_AutoWriteLock lock,
const UT_StringRef usd_material_path,
const UT_StringRef usd_parent_path,
const UT_StringRef usd_shader_name,
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. usd_shader_name - name of the shader primitive to create, (may be an empty string, in which case use node name, etc). 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_VexShaderTranslator::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_VexShaderTranslator::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_VexShaderTranslator::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: