MDL SDK API nvidia_logo_transpbg.gif Up
mi::mdl::IDistiller_plugin_api Class Referenceabstract

The rule engine handles the transformation of a compiled material by a rule set. More...

#include <mdl_distiller_plugin_api.h>

Classes

struct  strcmp_string_less
 == Node attributes ============================================================= More...
 

Public Types

enum  Field_selector {
  FS_NONE = 0x0000 ,
  FS_MATERIAL_THIN_WALLED = 0x0001 ,
  FS_MATERIAL_SURFACE_SCATTERING = 0x0002 ,
  FS_MATERIAL_SURFACE_EMISSION_EMISSION = 0x0004 ,
  FS_MATERIAL_SURFACE_EMISSION_INTENSITY = 0x0008 ,
  FS_MATERIAL_SURFACE_EMISSION_MODE = 0x0010 ,
  FS_MATERIAL_SURFACE_EMISSION = 0x001c ,
  FS_MATERIAL_SURFACE = 0x001e ,
  FS_MATERIAL_BACKFACE_SCATTERING = 0x0020 ,
  FS_MATERIAL_BACKFACE_EMISSION_EMISSION = 0x0040 ,
  FS_MATERIAL_BACKFACE_EMISSION_INTENSITY = 0x0080 ,
  FS_MATERIAL_BACKFACE_EMISSION_MODE = 0x0100 ,
  FS_MATERIAL_BACKFACE_EMISSION = 0x01c0 ,
  FS_MATERIAL_BACKFACE = 0x01e0 ,
  FS_MATERIAL_IOR = 0x0200 ,
  FS_MATERIAL_VOLUME_SCATTERING = 0x0400 ,
  FS_MATERIAL_VOLUME_ABSORPTION_COEFFICIENT = 0x0800 ,
  FS_MATERIAL_VOLUME_SCATTERING_COEFFICIENT = 0x1000 ,
  FS_MATERIAL_VOLUME = 0x1c00 ,
  FS_MATERIAL_GEOMETRY_DISPLACEMENT = 0x2000 ,
  FS_MATERIAL_GEOMETRY_CUTOUT_OPACITY = 0x4000 ,
  FS_MATERIAL_GEOMETRY_NORMAL = 0x8000 ,
  FS_MATERIAL_GEOMETRY = 0xe000 ,
  FS_MATERIAL_HAIR = 0x10000
}
 ================================================================================ More...
 
enum  Unary_operator
 Supported unary operators in the DAG representation. More...
 
enum  Binary_operator {
  OK_SELECT = IExpression_binary::OK_SELECT ,
  OK_ARRAY_INDEX = IExpression_binary::OK_ARRAY_INDEX ,
  OK_MULTIPLY = IExpression_binary::OK_MULTIPLY ,
  OK_DIVIDE = IExpression_binary::OK_DIVIDE ,
  OK_MODULO = IExpression_binary::OK_MODULO ,
  OK_PLUS = IExpression_binary::OK_PLUS ,
  OK_MINUS = IExpression_binary::OK_MINUS ,
  OK_SHIFT_LEFT = IExpression_binary::OK_SHIFT_LEFT ,
  OK_SHIFT_RIGHT = IExpression_binary::OK_SHIFT_RIGHT ,
  OK_UNSIGNED_SHIFT_RIGHT = IExpression_binary::OK_UNSIGNED_SHIFT_RIGHT ,
  OK_LESS = IExpression_binary::OK_LESS ,
  OK_LESS_OR_EQUAL = IExpression_binary::OK_LESS_OR_EQUAL ,
  OK_GREATER_OR_EQUAL = IExpression_binary::OK_GREATER_OR_EQUAL ,
  OK_GREATER = IExpression_binary::OK_GREATER ,
  OK_EQUAL = IExpression_binary::OK_EQUAL ,
  OK_NOT_EQUAL = IExpression_binary::OK_NOT_EQUAL ,
  OK_BITWISE_AND = IExpression_binary::OK_BITWISE_AND ,
  OK_BITWISE_XOR = IExpression_binary::OK_BITWISE_XOR ,
  OK_BITWISE_OR = IExpression_binary::OK_BITWISE_OR ,
  OK_LOGICAL_AND = IExpression_binary::OK_LOGICAL_AND ,
  OK_LOGICAL_OR = IExpression_binary::OK_LOGICAL_OR
}
 Supported binary operators in the DAG representation. More...
 

Public Member Functions

virtual IGenerated_code_dag::IMaterial_instanceapply_rules (IGenerated_code_dag::IMaterial_instance const *inst, IRule_matcher &matcher, IRule_matcher_event *event_handler, const Distiller_options *options, mi::Sint32 &error)=0
 Apply rules using a strategy. More...
 
virtual void set_attribute (DAG_node const *node, char const *name, DAG_node const *value)=0
 Set the value of a named attribute of a node. More...
 
virtual void remove_attributes (DAG_node const *node)=0
 Remove all attributes from the given DAG node. More...
 
virtual DAG_node const * get_attribute (DAG_node const *node, char const *name)=0
 Get the value of an attribute for the given DAG node. More...
 
virtual bool attribute_exists (DAG_node const *node, char const *name)=0
 Check whether a named attribute exists for a DAG node. More...
 
virtual void move_attributes (DAG_node const *to_node, DAG_node const *from_node)=0
 Move all nodes from from_node to node to_node, removing them from from_node. More...
 
virtual IGenerated_code_dag::IMaterial_instancemerge_materials (IGenerated_code_dag::IMaterial_instance const *m0, IGenerated_code_dag::IMaterial_instance const *m1, Field_selector field_selector)=0
 Returns a new material instance as a merge of two material instances based on a material field selection mask choosing the top-level material fields between the two materials. More...
 
virtual DAG_constant const * create_constant (IValue const *value)=0
 Create a constant. More...
 
virtual DAG_temporary const * create_temporary (DAG_node const *node, int index)=0
 Create a temporary reference. More...
 
virtual DAG_node const * create_call (char const *name, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], int num_call_args, IType const *ret_type)=0
 Create a call. More...
 
virtual DAG_node const * create_function_call (char const *name, DAG_node const *const call_args[], size_t num_call_args)=0
 Create a function call for a non-overloaded function. More...
 
virtual DAG_node const * create_mixer_call (DAG_call::Call_argument const call_args[], int num_call_args)=0
 Create a 1-, 2-, 3-, or 4-mixer call, with 2, 4, 6, or 8 parameters respectively. More...
 
virtual DAG_node const * create_color_mixer_call (DAG_call::Call_argument const call_args[], int num_call_args)=0
 Create a 1-, 2-, 3-, or 4-color-mixer call, with 2, 4, 6, or 8 parameters respectively. More...
 
virtual DAG_parameter const * create_parameter (IType const *type, int index)=0
 Create a parameter reference. More...
 
virtual IType_factory * get_type_factory ()=0
 Get the type factory associated with this expression factory. More...
 
virtual IValue_factory * get_value_factory ()=0
 Get the value factory associated with this expression factory. More...
 
virtual IType const * get_bsdf_component_type ()=0
 Return the type for ::df::bsdf_component. More...
 
virtual IType const * get_edf_component_type ()=0
 Return the type for ::df::edf_component. More...
 
virtual IType const * get_vdf_component_type ()=0
 Return the type for ::df::vdf_component. More...
 
virtual IType const * get_bsdf_component_array_type (int n_values)=0
 Return the type for ::df::bsdf_component. More...
 
virtual IType const * get_edf_component_array_type (int n_values)=0
 Return the type for ::df::edf_component. More...
 
virtual IType const * get_vdf_component_array_type (int n_values)=0
 Return the type for ::df::vdf_component. More...
 
virtual IType const * get_color_bsdf_component_type ()=0
 Return the type for ::df::color_bsdf_component. More...
 
virtual IType const * get_color_edf_component_type ()=0
 Return the type for ::df::color_edf_component. More...
 
virtual IType const * get_color_vdf_component_type ()=0
 Return the type for ::df::color_vdf_component. More...
 
virtual IType const * get_color_bsdf_component_array_type (int n_values)=0
 Return the type for ::df::color_bsdf_component. More...
 
virtual IType const * get_color_edf_component_array_type (int n_values)=0
 Return the type for ::df::color_edf_component. More...
 
virtual IType const * get_color_vdf_component_array_type (int n_values)=0
 Return the type for ::df::color_vdf_component. More...
 
virtual IType const * get_bool_type ()=0
 Return the type for bool. More...
 
virtual DAG_node const * create_unary (Unary_operator op, DAG_node const *o)=0
 Creates an operator, handles types. More...
 
virtual DAG_node const * create_binary (Binary_operator op, DAG_node const *l, DAG_node const *r)=0
 Creates an operator, handles types. More...
 
virtual DAG_node const * create_ternary (DAG_node const *cond, DAG_node const *t_expr, DAG_node const *f_expr)=0
 Creates a ternary operator. More...
 
virtual DAG_node const * create_select (DAG_node const *s, char const *member)=0
 Creates a SELECT operator on a struct or vector. More...
 
virtual DAG_node const * create_array (IType const *elem_type, DAG_node const *const values[], size_t n_values)=0
 Creates an array constructor. More...
 
virtual DAG_constant const * create_bool_constant (bool f)=0
 Creates a boolean constant. More...
 
virtual DAG_constant const * create_int_constant (int i)=0
 Creates an integer constant. More...
 
virtual DAG_constant const * create_emission_enum_constant (int i)=0
 Creates a constant of the predefined intensity_mode enum. More...
 
virtual DAG_constant const * create_scatter_enum_constant (int i)=0
 Creates a constant of the df::scatter_mode enum. More...
 
virtual DAG_constant const * create_wrap_mode_enum_constant (int i)=0
 Creates a constant of the tex::wrap_mode enum. More...
 
virtual DAG_constant const * create_float_constant (float f)=0
 Creates a floating point constant. More...
 
virtual DAG_constant const * create_float3_constant (float x, float y, float z)=0
 Creates a float3 constant. More...
 
virtual DAG_constant const * create_color_constant (float r, float g, float b)=0
 Creates a RGB color constant. More...
 
virtual DAG_constant const * create_global_ior ()=0
 Creates a RGB color constant of the global material IOR value. More...
 
virtual DAG_constant const * create_global_float_ior ()=0
 Creates a float constant of the global material IOR green value. More...
 
virtual DAG_constant const * create_string_constant (char const *s)=0
 Creates a string constant. More...
 
virtual DAG_constant const * create_bsdf_constant ()=0
 Creates an invalid bsdf. More...
 
virtual DAG_constant const * create_edf_constant ()=0
 Creates an invalid edf. More...
 
virtual DAG_constant const * create_vdf_constant ()=0
 Creates an invalid vdf. More...
 
virtual DAG_constant const * create_hair_bsdf_constant ()=0
 Creates an invalid hair_bsdf. More...
 
virtual DAG_node const * create_bsdf_component (DAG_node const *weight_arg, DAG_node const *bsdf_arg)=0
 Create a bsdf_component for a mixer; can be a call or a constant. More...
 
virtual DAG_node const * create_edf_component (DAG_node const *weight_arg, DAG_node const *edf_arg)=0
 Create a edf_component for a mixer; can be a call or a constant. More...
 
virtual DAG_node const * create_vdf_component (DAG_node const *weight_arg, DAG_node const *vdf_arg)=0
 Create a vdf_component for a mixer; can be a call or a constant. More...
 
virtual DAG_node const * create_color_bsdf_component (DAG_node const *weight_arg, DAG_node const *bsdf_arg)=0
 Create a bsdf_color_component for a color mixer; can be a call or a constant. More...
 
virtual DAG_node const * create_color_edf_component (DAG_node const *weight_arg, DAG_node const *edf_arg)=0
 Create a edf_color_component for a color mixer; can be a call or a constant. More...
 
virtual DAG_node const * create_color_vdf_component (DAG_node const *weight_arg, DAG_node const *edf_arg)=0
 Create a vdf_color_component for a color mixer; can be a call or a constant. More...
 
virtual DAG_constant const * mk_constant (const char *const_type, const char *value)=0
 Create a constant node for a given type and value. More...
 
virtual DAG_node const * mk_default (const char *param_type, const char *param_default)=0
 Create DAG_node's for possible default values of Node_types parameter. More...
 
virtual size_t get_compound_argument_size (DAG_node const *node)=0
 Returns the argument count if node is non-null and of the call kind or a compound constant, and 0 otherwise. More...
 
virtual DAG_node const * get_compound_argument (DAG_node const *node, size_t i)=0
 Return the i-th argument if node is non-null and of the call kind, or a compound constant, and NULL otherwise. More...
 
virtual DAG_node const * get_remapped_argument (DAG_node const *node, size_t i)=0
 Return the i-th argument if node is non-null and of the call kind, or a compound constant, and NULL otherwise; remaps index for special case handling of mixers and parameter order of glossy BSDFs. More...
 
virtual char const * get_compound_parameter_name (DAG_node const *node, size_t i) const =0
 Returns the name of the i-th parameter of node, or NULL if there is none or node is NULL. More...
 
virtual bool eval_if (DAG_node const *node)=0
 Returns true if node evaluates to true. More...
 
virtual bool eval_maybe_if (DAG_node const *node)=0
 Returns true if node is not evaluating to false, i.e., it either evaluates to true or cannot be evaluated. More...
 
virtual int get_selector (DAG_node const *node) const =0
 Compute the node selector for the matcher, either the semantic for a DAG_call node, or one of the Distiller_extended_node_semantics covering DAG_constant of type bsdf, edf or vdf respectively, or for DAG_constant's and DAG_call's of one of the material structs, and selectors for mix_1, mix_2, mix_3, mix_4, clamped_mix_1, ..., as well as a special selector for local_normal. More...
 
virtual bool all_nodes (IRule_matcher::Checker_function test_fct, DAG_node const *node)=0
 Checks recursively for all call nodes if the property test_fct returns true. More...
 
virtual bool set_normalize_mixers (bool new_value)=0
 Set the normalization of mixer node flag and return its previous value. More...
 
virtual IGenerated_code_dag::IMaterial_instancenormalize_mixers (IGenerated_code_dag::IMaterial_instance const *inst, IRule_matcher_event *event_handler, const mi::mdl::Distiller_options *options, mi::Sint32 &error)=0
 Normalize mixer nodes and set respective flag to keep them normalized. More...
 
virtual void release () const =0
 Immediately deletes this distiller plugin API. More...
 

Static Public Member Functions

static IDistiller_plugin_apiget_new_distiller_plugin_api (IGenerated_code_dag::IMaterial_instance const *instance, ICall_name_resolver *call_resolver)
 Factory to create a newly allocated distiller plugin API. More...
 

Detailed Description

The rule engine handles the transformation of a compiled material by a rule set.

Member Enumeration Documentation

 Binary_operator

Supported binary operators in the DAG representation.

Enumerator
OK_SELECT 

"."

OK_ARRAY_INDEX 

"[]"

OK_MULTIPLY 

"*"

OK_DIVIDE 

"/"

OK_MODULO 

"%"

OK_PLUS 

"+"

OK_MINUS 

"-"

OK_SHIFT_LEFT 

"<<"

OK_SHIFT_RIGHT 

">>"

OK_UNSIGNED_SHIFT_RIGHT 

">>>"

OK_LESS 

"<"

OK_LESS_OR_EQUAL 

"<="

OK_GREATER_OR_EQUAL 

">="

OK_GREATER 

">"

OK_EQUAL 

"=="

OK_NOT_EQUAL 

"!="

OK_BITWISE_AND 

"&"

OK_BITWISE_XOR 

"^"

OK_BITWISE_OR 

"|"

OK_LOGICAL_AND 

"&&"

OK_LOGICAL_OR 

"||"

 Field_selector

================================================================================

Field selectors, can be or'ed together to form a bit mask.

Enumerator
FS_NONE 

no fields copied

FS_MATERIAL_THIN_WALLED 

thin_walled field

FS_MATERIAL_SURFACE_SCATTERING 

surface.scattering field

FS_MATERIAL_SURFACE_EMISSION_EMISSION 

surface.emission.emission field

FS_MATERIAL_SURFACE_EMISSION_INTENSITY 

surface.emission.intensity field

FS_MATERIAL_SURFACE_EMISSION_MODE 

surface.emission.mode field

FS_MATERIAL_SURFACE_EMISSION 

all surface.emission fields

FS_MATERIAL_SURFACE 

all surface fields

FS_MATERIAL_BACKFACE_SCATTERING 

backface.scattering field

FS_MATERIAL_BACKFACE_EMISSION_EMISSION 

backface.emission.emission field

FS_MATERIAL_BACKFACE_EMISSION_INTENSITY 

backface.emission.intensity field

FS_MATERIAL_BACKFACE_EMISSION_MODE 

backface.emission.mode field

FS_MATERIAL_BACKFACE_EMISSION 

all backface.emission fields

FS_MATERIAL_BACKFACE 

all backface fields

FS_MATERIAL_IOR 

ior field

FS_MATERIAL_VOLUME_SCATTERING 

volume.scattering field

FS_MATERIAL_VOLUME_ABSORPTION_COEFFICIENT 

volume.absorption_coefficient field

FS_MATERIAL_VOLUME_SCATTERING_COEFFICIENT 

volume.scattering_coefficient field

FS_MATERIAL_VOLUME 

all volume fields

FS_MATERIAL_GEOMETRY_DISPLACEMENT 

geometry.displacement field

FS_MATERIAL_GEOMETRY_CUTOUT_OPACITY 

geometry.cutout_opacity field

FS_MATERIAL_GEOMETRY_NORMAL 

geometry.normal field

FS_MATERIAL_GEOMETRY 

all geometry fields

FS_MATERIAL_HAIR 

hair field

 Unary_operator

Supported unary operators in the DAG representation.

Member Function Documentation

 all_nodes()

virtual bool mi::mdl::IDistiller_plugin_api::all_nodes ( IRule_matcher::Checker_function  test_fct,
DAG_node const *  node 
)
pure virtual

Checks recursively for all call nodes if the property test_fct returns true.

 apply_rules()

virtual IGenerated_code_dag::IMaterial_instance * mi::mdl::IDistiller_plugin_api::apply_rules ( IGenerated_code_dag::IMaterial_instance const *  inst,
IRule_matcher matcher,
IRule_matcher_event event_handler,
const Distiller_options options,
mi::Sint32 error 
)
pure virtual

Apply rules using a strategy.

Parameters
insta compiled material instance
matchera rule set matcher
event_handlerif non-NULL, a event handler to report events during processing
optionsthe strategy to use
errorerror codes reported back to the API
Returns
a new compiled material

 attribute_exists()

virtual bool mi::mdl::IDistiller_plugin_api::attribute_exists ( DAG_node const *  node,
char const *  name 
)
pure virtual

Check whether a named attribute exists for a DAG node.

Parameters
nodenode for which to check for attribute presence (must not be NULL)
namename of the attribute (must not be NULL)
Returns
true if the attribute exists, false otherwise

 create_array()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_array ( IType const *  elem_type,
DAG_node const *const  values[],
size_t  n_values 
)
pure virtual

Creates an array constructor.

Parameters
elem_typethe element type of the array, might be NULL iff n_values > 0
valuesthe array elements
n_valuesnumber of values
Note
the element type cannot be derived from the values for zero-length arrays

 create_binary()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_binary ( Binary_operator  op,
DAG_node const *  l,
DAG_node const *  r 
)
pure virtual

Creates an operator, handles types.

Parameters
opthe operator
lthe left operand
rthe right operand
Returns
a DAG representing l op r

 create_bool_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_bool_constant ( bool  f)
pure virtual

Creates a boolean constant.

 create_bsdf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_bsdf_component ( DAG_node const *  weight_arg,
DAG_node const *  bsdf_arg 
)
pure virtual

Create a bsdf_component for a mixer; can be a call or a constant.

 create_bsdf_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_bsdf_constant ( )
pure virtual

Creates an invalid bsdf.

 create_call()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_call ( char const *  name,
IDefinition::Semantics  sema,
DAG_call::Call_argument const  call_args[],
int  num_call_args,
IType const *  ret_type 
)
pure virtual

Create a call.

Parameters
nameThe name of the called function.
semaThe semantics of the called function.
call_argsThe call arguments of the called function.
num_call_argsThe number of call arguments.
ret_typeThe return type of the function.
Returns
The created call or an equivalent expression.

 create_color_bsdf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_color_bsdf_component ( DAG_node const *  weight_arg,
DAG_node const *  bsdf_arg 
)
pure virtual

Create a bsdf_color_component for a color mixer; can be a call or a constant.

 create_color_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_color_constant ( float  r,
float  g,
float  b 
)
pure virtual

Creates a RGB color constant.

 create_color_edf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_color_edf_component ( DAG_node const *  weight_arg,
DAG_node const *  edf_arg 
)
pure virtual

Create a edf_color_component for a color mixer; can be a call or a constant.

 create_color_mixer_call()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_color_mixer_call ( DAG_call::Call_argument const  call_args[],
int  num_call_args 
)
pure virtual

Create a 1-, 2-, 3-, or 4-color-mixer call, with 2, 4, 6, or 8 parameters respectively.

 create_color_vdf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_color_vdf_component ( DAG_node const *  weight_arg,
DAG_node const *  edf_arg 
)
pure virtual

Create a vdf_color_component for a color mixer; can be a call or a constant.

 create_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_constant ( IValue const *  value)
pure virtual

Create a constant.

Parameters
valueThe value of the constant.
Returns
The created constant.

 create_edf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_edf_component ( DAG_node const *  weight_arg,
DAG_node const *  edf_arg 
)
pure virtual

Create a edf_component for a mixer; can be a call or a constant.

 create_edf_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_edf_constant ( )
pure virtual

Creates an invalid edf.

 create_emission_enum_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_emission_enum_constant ( int  i)
pure virtual

Creates a constant of the predefined intensity_mode enum.

Parameters
ithe index of the enum value

 create_float3_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_float3_constant ( float  x,
float  y,
float  z 
)
pure virtual

Creates a float3 constant.

 create_float_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_float_constant ( float  f)
pure virtual

Creates a floating point constant.

 create_function_call()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_function_call ( char const *  name,
DAG_node const *const  call_args[],
size_t  num_call_args 
)
pure virtual

Create a function call for a non-overloaded function.

All parameter and return types are deduced from the function definition.

Parameters
nameThe name of the called function, e.g., "::state::normal".
call_argsThe call arguments of the called function.
num_call_argsThe number of call arguments.
Returns
The created call or an equivalent expression.

 create_global_float_ior()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_global_float_ior ( )
pure virtual

Creates a float constant of the global material IOR green value.

 create_global_ior()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_global_ior ( )
pure virtual

Creates a RGB color constant of the global material IOR value.

 create_hair_bsdf_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_hair_bsdf_constant ( )
pure virtual

Creates an invalid hair_bsdf.

 create_int_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_int_constant ( int  i)
pure virtual

Creates an integer constant.

 create_mixer_call()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_mixer_call ( DAG_call::Call_argument const  call_args[],
int  num_call_args 
)
pure virtual

Create a 1-, 2-, 3-, or 4-mixer call, with 2, 4, 6, or 8 parameters respectively.

 create_parameter()

virtual DAG_parameter const * mi::mdl::IDistiller_plugin_api::create_parameter ( IType const *  type,
int  index 
)
pure virtual

Create a parameter reference.

Parameters
typeThe type of the parameter
indexThe index of the parameter.
Returns
The created parameter reference.

 create_scatter_enum_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_scatter_enum_constant ( int  i)
pure virtual

Creates a constant of the df::scatter_mode enum.

Parameters
ithe index of the enum value

 create_select()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_select ( DAG_node const *  s,
char const *  member 
)
pure virtual

Creates a SELECT operator on a struct or vector.

Parameters
sa node producing a struct typed result
memberthe name of the member to select

 create_string_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_string_constant ( char const *  s)
pure virtual

Creates a string constant.

 create_temporary()

virtual DAG_temporary const * mi::mdl::IDistiller_plugin_api::create_temporary ( DAG_node const *  node,
int  index 
)
pure virtual

Create a temporary reference.

Parameters
nodeThe DAG node that is "named" by this temporary.
indexThe index of the temporary.
Returns
The created temporary reference.

 create_ternary()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_ternary ( DAG_node const *  cond,
DAG_node const *  t_expr,
DAG_node const *  f_expr 
)
pure virtual

Creates a ternary operator.

Parameters
condthe condition
t_exprthe true expression
f_exprthe false expression
Returns
a DAG representing cond ? t_expr : f_expr

 create_unary()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_unary ( Unary_operator  op,
DAG_node const *  o 
)
pure virtual

Creates an operator, handles types.

Parameters
opthe operator
othe operand
Returns
a DAG representing l op r

 create_vdf_component()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::create_vdf_component ( DAG_node const *  weight_arg,
DAG_node const *  vdf_arg 
)
pure virtual

Create a vdf_component for a mixer; can be a call or a constant.

 create_vdf_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_vdf_constant ( )
pure virtual

Creates an invalid vdf.

 create_wrap_mode_enum_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::create_wrap_mode_enum_constant ( int  i)
pure virtual

Creates a constant of the tex::wrap_mode enum.

Parameters
ithe index of the enum value

 eval_if()

virtual bool mi::mdl::IDistiller_plugin_api::eval_if ( DAG_node const *  node)
pure virtual

Returns true if node evaluates to true.

 eval_maybe_if()

virtual bool mi::mdl::IDistiller_plugin_api::eval_maybe_if ( DAG_node const *  node)
pure virtual

Returns true if node is not evaluating to false, i.e., it either evaluates to true or cannot be evaluated.

 get_attribute()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::get_attribute ( DAG_node const *  node,
char const *  name 
)
pure virtual

Get the value of an attribute for the given DAG node.

Parameters
nodenode for which to get the attribute (must not be NULL)
namename of the attribute (must not be NULL)
Returns
value of the attribute or NULL if the attribute does not exist.

 get_bool_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_bool_type ( )
pure virtual

Return the type for bool.

 get_bsdf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_bsdf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::bsdf_component.

 get_bsdf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_bsdf_component_type ( )
pure virtual

Return the type for ::df::bsdf_component.

 get_color_bsdf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_bsdf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::color_bsdf_component.

 get_color_bsdf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_bsdf_component_type ( )
pure virtual

Return the type for ::df::color_bsdf_component.

 get_color_edf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_edf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::color_edf_component.

 get_color_edf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_edf_component_type ( )
pure virtual

Return the type for ::df::color_edf_component.

 get_color_vdf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_vdf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::color_vdf_component.

 get_color_vdf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_color_vdf_component_type ( )
pure virtual

Return the type for ::df::color_vdf_component.

 get_compound_argument()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::get_compound_argument ( DAG_node const *  node,
size_t  i 
)
pure virtual

Return the i-th argument if node is non-null and of the call kind, or a compound constant, and NULL otherwise.

 get_compound_argument_size()

virtual size_t mi::mdl::IDistiller_plugin_api::get_compound_argument_size ( DAG_node const *  node)
pure virtual

Returns the argument count if node is non-null and of the call kind or a compound constant, and 0 otherwise.

 get_compound_parameter_name()

virtual char const * mi::mdl::IDistiller_plugin_api::get_compound_parameter_name ( DAG_node const *  node,
size_t  i 
) const
pure virtual

Returns the name of the i-th parameter of node, or NULL if there is none or node is NULL.

 get_edf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_edf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::edf_component.

 get_edf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_edf_component_type ( )
pure virtual

Return the type for ::df::edf_component.

 get_new_distiller_plugin_api()

static IDistiller_plugin_api * mi::mdl::IDistiller_plugin_api::get_new_distiller_plugin_api ( IGenerated_code_dag::IMaterial_instance const *  instance,
ICall_name_resolver *  call_resolver 
)
static

Factory to create a newly allocated distiller plugin API.

The interface is not reference counted. Call release() immediately deletes it.

Parameters
instancea material instance used to retrieve an allocator
call_resolvera MDL call name resolver for the IR checker

 get_remapped_argument()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::get_remapped_argument ( DAG_node const *  node,
size_t  i 
)
pure virtual

Return the i-th argument if node is non-null and of the call kind, or a compound constant, and NULL otherwise; remaps index for special case handling of mixers and parameter order of glossy BSDFs.

 get_selector()

virtual int mi::mdl::IDistiller_plugin_api::get_selector ( DAG_node const *  node) const
pure virtual

Compute the node selector for the matcher, either the semantic for a DAG_call node, or one of the Distiller_extended_node_semantics covering DAG_constant of type bsdf, edf or vdf respectively, or for DAG_constant's and DAG_call's of one of the material structs, and selectors for mix_1, mix_2, mix_3, mix_4, clamped_mix_1, ..., as well as a special selector for local_normal.

All other nodes return 0.

 get_type_factory()

virtual IType_factory * mi::mdl::IDistiller_plugin_api::get_type_factory ( )
pure virtual

Get the type factory associated with this expression factory.

Returns
The type factory.

 get_value_factory()

virtual IValue_factory * mi::mdl::IDistiller_plugin_api::get_value_factory ( )
pure virtual

Get the value factory associated with this expression factory.

Returns
The value factory.

 get_vdf_component_array_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_vdf_component_array_type ( int  n_values)
pure virtual

Return the type for ::df::vdf_component.

 get_vdf_component_type()

virtual IType const * mi::mdl::IDistiller_plugin_api::get_vdf_component_type ( )
pure virtual

Return the type for ::df::vdf_component.

 merge_materials()

virtual IGenerated_code_dag::IMaterial_instance * mi::mdl::IDistiller_plugin_api::merge_materials ( IGenerated_code_dag::IMaterial_instance const *  m0,
IGenerated_code_dag::IMaterial_instance const *  m1,
Field_selector  field_selector 
)
pure virtual

Returns a new material instance as a merge of two material instances based on a material field selection mask choosing the top-level material fields between the two materials.

Parameters
m0the material instance whose fields are chosen if the mask bit is 0.
m1the material instance whose fields are chosen if the mask bit is 1.
field_selectormask to select the fields from m0 or m1 respectively.
Returns
a new compiled material instance.

 mk_constant()

virtual DAG_constant const * mi::mdl::IDistiller_plugin_api::mk_constant ( const char *  const_type,
const char *  value 
)
pure virtual

Create a constant node for a given type and value.

 mk_default()

virtual DAG_node const * mi::mdl::IDistiller_plugin_api::mk_default ( const char *  param_type,
const char *  param_default 
)
pure virtual

Create DAG_node's for possible default values of Node_types parameter.

 move_attributes()

virtual void mi::mdl::IDistiller_plugin_api::move_attributes ( DAG_node const *  to_node,
DAG_node const *  from_node 
)
pure virtual

Move all nodes from from_node to node to_node, removing them from from_node.

Parameters
to_nodenode to which to assign the attributes
from_nodenode from which to move the attributes

 normalize_mixers()

virtual IGenerated_code_dag::IMaterial_instance * mi::mdl::IDistiller_plugin_api::normalize_mixers ( IGenerated_code_dag::IMaterial_instance const *  inst,
IRule_matcher_event event_handler,
const mi::mdl::Distiller_options options,
mi::Sint32 error 
)
pure virtual

Normalize mixer nodes and set respective flag to keep them normalized.

Parameters
insta compiled material instance
event_handlerif non-NULL, a event handler to report events during processing
optionsoptions for this rule set, currently none used.
errorerror codes reported back to the API
Returns
a new compiled material

 release()

virtual void mi::mdl::IDistiller_plugin_api::release ( ) const
pure virtual

Immediately deletes this distiller plugin API.

 remove_attributes()

virtual void mi::mdl::IDistiller_plugin_api::remove_attributes ( DAG_node const *  node)
pure virtual

Remove all attributes from the given DAG node.

Parameters
nodenode for which to remove all attributes

 set_attribute()

virtual void mi::mdl::IDistiller_plugin_api::set_attribute ( DAG_node const *  node,
char const *  name,
DAG_node const *  value 
)
pure virtual

Set the value of a named attribute of a node.

If the node already has the attribute, its value is overwritten.

Parameters
nodenode to attach attribute to (must not be NULL)
namename of the attribute (must not be NULL)
valuenew value of the attribute (must not be NULL)

 set_normalize_mixers()

virtual bool mi::mdl::IDistiller_plugin_api::set_normalize_mixers ( bool  new_value)
pure virtual

Set the normalization of mixer node flag and return its previous value.