HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_ScriptMaterialCodeMapper Class Referenceabstract

Mapper that provides an HDA section name for a given shader node. More...

#include <VOP_ScriptMaterialInfo.h>

Public Member Functions

virtual ~VOP_ScriptMaterialCodeMapper ()
 
virtual void mapToVexCodeSection (UT_String &section_name, VOP_Node *shader_node, VOP_Type shader_type, bool is_encapsulated)=0
 
virtual bool isPrimaryOutput (VOP_Node *shader_node, VOP_Type shader_type) const =0
 

Detailed Description

Mapper that provides an HDA section name for a given shader node.

The shader may be a material component shader or an encapsulated shader. The material component shader can be invoked by arbitrary caller (eg, a renderer or another shader). The encapsulated shaders are referenced by procedural geometry VOPs inside the material, and are not really available to the outside world for direct calls. They can be indirectly manipulated thru parameters promoted to the parent material.

Definition at line 243 of file VOP_ScriptMaterialInfo.h.

Constructor & Destructor Documentation

virtual VOP_ScriptMaterialCodeMapper::~VOP_ScriptMaterialCodeMapper ( )
inlinevirtual

Definition at line 247 of file VOP_ScriptMaterialInfo.h.

Member Function Documentation

virtual bool VOP_ScriptMaterialCodeMapper::isPrimaryOutput ( VOP_Node shader_node,
VOP_Type  shader_type 
) const
pure virtual

Checks if the shader node was added as part of the primary output compilation phase. These nodes don't have phantom nodes, but rather reference a saved code section directly.

virtual void VOP_ScriptMaterialCodeMapper::mapToVexCodeSection ( UT_String section_name,
VOP_Node shader_node,
VOP_Type  shader_type,
bool  is_encapsulated 
)
pure virtual

Maps the shader node to an HDA section name that contains the code generated by that shader node. The shader node should generate own code, because mapper may try to compile and store it in the section. Returns, previously added mapped section name if already added, or adds and returns a newly constructed shection name.

Parameters
section_nameThe outgoing argument that will contain the section name that contains the shader's vex code.
shader_nodeThe shader node whose code is in the mapped section name.
shader_typeThe type of shader code to look for (one node may be able to provide a few vex code chunks, each for a different shader type).
is_encapsulatedIf true, the shader is mareked as encapsulated, which influences how the shader node is treated with regards purpose of calling it from the geometry procedurals (without import directoves), rather than as an explicit VEX shader call from another VEX shader (which require import directives, etc).

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