NVIDIA Iray SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MDL type system

The MDL type system mainly consists of four sets of interfaces: More...

Classes

class  mi::neuraylib::IExpression
 The interface to MDL expressions. More...
 
class  mi::neuraylib::IExpression_constant
 A constant expression. More...
 
class  mi::neuraylib::IExpression_call
 An indirect call expression. More...
 
class  mi::neuraylib::IExpression_parameter
 A parameter reference expression. More...
 
class  mi::neuraylib::IExpression_direct_call
 A direct call expression. More...
 
class  mi::neuraylib::IExpression_temporary
 A temporary reference expression. More...
 
class  mi::neuraylib::IExpression_list
 An ordered collection of expressions identified by name or index. More...
 
class  mi::neuraylib::IAnnotation
 An annotation is similar to a direct call expression, but without corresponding definition and return type. More...
 
class  mi::neuraylib::IAnnotation_block
 An annotation block is an array of annotations. More...
 
class  mi::neuraylib::IAnnotation_list
 An ordered collection of annotation blocks identified by name or index. More...
 
class  mi::neuraylib::IExpression_factory
 The interface for creating expressions. More...
 
class  mi::neuraylib::IMdl_archive_api
 This API component provides functionality related to MDL archives. More...
 
class  mi::neuraylib::IManifest
 Represents the manifest in an MDL archive. More...
 
class  mi::neuraylib::IMdl_distiller_api
 Provides access to various functionality related to MDL distilling. More...
 
class  mi::neuraylib::IBaker
 Allows to bake a varying or uniform expression of a compiled material into a texture or constant. More...
 
class  mi::neuraylib::IMdl_evaluator_api
 Provides access to various functions for the evaluation of MDL expressions. More...
 
class  mi::neuraylib::IMdl_factory
 Factory for various MDL interfaces and functions. More...
 
class  mi::neuraylib::IType
 The interface to MDL types. More...
 
class  mi::neuraylib::IType_alias
 The type of kind alias. More...
 
class  mi::neuraylib::IType_atomic
 An atomic type. More...
 
class  mi::neuraylib::IType_bool
 The type of kind bool. More...
 
class  mi::neuraylib::IType_int
 The type of kind int. More...
 
class  mi::neuraylib::IType_enum
 A type of kind enum. More...
 
class  mi::neuraylib::IType_float
 The type of kind float. More...
 
class  mi::neuraylib::IType_double
 The type of kind double. More...
 
class  mi::neuraylib::IType_string
 The type of kind string. More...
 
class  mi::neuraylib::IType_compound
 A compound type. More...
 
class  mi::neuraylib::IType_vector
 The type of kind vector. More...
 
class  mi::neuraylib::IType_matrix
 The type of kind matrix. More...
 
class  mi::neuraylib::IType_color
 The type of kind color. More...
 
class  mi::neuraylib::IType_array
 The type of kind array. More...
 
class  mi::neuraylib::IType_struct
 The type of kind struct. More...
 
class  mi::neuraylib::IType_reference
 The reference types. More...
 
class  mi::neuraylib::IType_resource
 A string valued resource type. More...
 
class  mi::neuraylib::IType_texture
 The type of kind texture. More...
 
class  mi::neuraylib::IType_light_profile
 The type of kind light_profile. More...
 
class  mi::neuraylib::IType_bsdf_measurement
 The type of kind bsdf_measurement. More...
 
class  mi::neuraylib::IType_df
 The type of distribution functions. More...
 
class  mi::neuraylib::IType_bsdf
 The type of kind bsdf. More...
 
class  mi::neuraylib::IType_edf
 The type of kind edf. More...
 
class  mi::neuraylib::IType_vdf
 The type of kind vdf. More...
 
class  mi::neuraylib::IType_list
 An ordered collection of types identified by name or index. More...
 
class  mi::neuraylib::IType_factory
 The interface for creating types. More...
 
class  mi::neuraylib::IValue
 The interface to MDL values. More...
 
class  mi::neuraylib::IValue_atomic
 An atomic value. More...
 
class  mi::neuraylib::IValue_bool
 A value of type boolean. More...
 
class  mi::neuraylib::IValue_int
 A value of type integer. More...
 
class  mi::neuraylib::IValue_enum
 A value of type enum. More...
 
class  mi::neuraylib::IValue_float
 A value of type float. More...
 
class  mi::neuraylib::IValue_double
 A value of type double. More...
 
class  mi::neuraylib::IValue_string
 A value of type string. More...
 
class  mi::neuraylib::IValue_compound
 A compound value. More...
 
class  mi::neuraylib::IValue_vector
 A value of type vector. More...
 
class  mi::neuraylib::IValue_matrix
 A value of type matrix. More...
 
class  mi::neuraylib::IValue_color
 A value of type color. More...
 
class  mi::neuraylib::IValue_array
 A value of type array. More...
 
class  mi::neuraylib::IValue_struct
 A value of type struct. More...
 
class  mi::neuraylib::IValue_resource
 Base class for resource values. More...
 
class  mi::neuraylib::IValue_texture
 A texture value. More...
 
class  mi::neuraylib::IValue_light_profile
 A light profile value. More...
 
class  mi::neuraylib::IValue_bsdf_measurement
 A BSDF measurement value. More...
 
class  mi::neuraylib::IValue_invalid_df
 An invalid distribution function value. More...
 
class  mi::neuraylib::IValue_list
 An ordered collection of values identified by name or index. More...
 
class  mi::neuraylib::IValue_factory
 The interface for creating values. More...
 

Enumerations

enum  mi::neuraylib::Baker_resource {
  mi::neuraylib::BAKE_ON_CPU,
  mi::neuraylib::BAKE_ON_GPU,
  mi::neuraylib::BAKE_ON_GPU_WITH_CPU_FALLBACK
}
 Identifies the resource(s) to be used by a baker. More...
 

Functions

template<class T >
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const T &v)
 Simplifies setting the value of mi::neuraylib::IValue from the corresponding classes from the base and math API. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const bool &v)
 This specialization handles mi::neuraylib::IValue_bool. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::Float32 &v)
 This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::Float64 &v)
 This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const char *v)
 This specialization handles mi::neuraylib::IValue_enum, mi::neuraylib::IValue_string and mi::neuraylib::IValue_resource. More...
 
template<class T , Size DIM>
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::math::Vector< T, DIM > &v)
 This specialization handles mi::neuraylib::IValue_vector. More...
 
template<class T , Size ROW, Size COL>
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::math::Matrix< T, ROW, COL > &v)
 This specialization handles mi::neuraylib::IValue_matrix. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::math::Color &v)
 This specialization handles mi::neuraylib::IValue_color. More...
 
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const mi::math::Spectrum &v)
 This specialization handles mi::neuraylib::IValue_color. More...
 
template<class T >
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, mi::Size index, const T &v)
 This variant handles elements of compounds identified via an additional index. More...
 
template<class T >
mi::Sint32 mi::neuraylib::set_value (mi::neuraylib::IValue *value, const char *name, const T &v)
 This variant handles fields of structs identified via an additional field name. More...
 
template<class T >
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, T &v)
 base and math API. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, bool &v)
 This specialization handles mi::neuraylib::IValue_bool. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::Float32 &v)
 This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::Float64 &v)
 This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, const char *&v)
 This specialization handles mi::neuraylib::IValue_enum, mi::neuraylib::IValue_string and mi::neuraylib::IValue_resource. More...
 
template<class T , Size DIM>
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::math::Vector< T, DIM > &v)
 This specialization handles mi::neuraylib::IValue_vector. More...
 
template<class T , Size ROW, Size COL>
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::math::Matrix< T, ROW, COL > &v)
 This specialization handles mi::neuraylib::IValue_matrix. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::math::Color &v)
 This specialization handles mi::neuraylib::IValue_color. More...
 
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::math::Spectrum &v)
 This specialization handles mi::neuraylib::IValue_color. More...
 
template<class T >
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, mi::Size index, T &v)
 This variant handles elements of compounds identified via an additional index. More...
 
template<class T >
mi::Sint32 mi::neuraylib::get_value (const mi::neuraylib::IValue *value, const char *name, T &v)
 This variant handles fields of structs identified via an additional field name. More...
 

Detailed Description

The MDL type system mainly consists of four sets of interfaces:

The three factories mentioned above can be obtained from mi::neuraylib::IMdl_factory.

In addition, the free functions mi::neuraylib::get_value() and mi::neuraylib::set_value() are useful to read and write instances of mi::neuraylib::IValue.

See MDL-related elements for MDL elements that make use of this type system.

Enumeration Type Documentation

Identifies the resource(s) to be used by a baker.

See Also
mi::neuraylib::IMdl_distiller_api::create_baker()
Enumerator
BAKE_ON_CPU 

Use only the CPU for texture baking.

BAKE_ON_GPU 

Use only the GPU for texture baking.

BAKE_ON_GPU_WITH_CPU_FALLBACK 

Prefer using the GPU for texture baking, use the CPU as fallback.

Function Documentation

template<class T >
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
T &  v 
)

base and math API.

Parameters
valueThe instance of mi::neuraylib::IValue to read.
[out]vThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.

This general template handles mi::neuraylib::IValue_int and mi::neuraylib::IValue_enum and expects mi::Uint32 as second argument. Since it is a template it will handle other types as second argument if they are accepted in place of parameters of type mi::Uint32, e.g., mi::Sint32.

mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
bool &  v 
)
inline

This specialization handles mi::neuraylib::IValue_bool.

It expects a bool as second argument. See mi::neuraylib::get_value() for details.

mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::Float32 v 
)
inline

This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double.

It expects an mi::Float32 as second argument. See mi::neuraylib::get_value() for details.

mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::Float64 v 
)
inline

This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double.

It expects an mi::Float64 as second argument. See mi::neuraylib::get_value() for details.

mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
const char *&  v 
)
inline

This specialization handles mi::neuraylib::IValue_enum, mi::neuraylib::IValue_string and mi::neuraylib::IValue_resource.

It expects a const char* as second argument. See mi::neuraylib::get_value() for details.

template<class T , Size DIM>
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::math::Vector< T, DIM > &  v 
)

This specialization handles mi::neuraylib::IValue_vector.

It expects an mi::math::Vector of matching dimension and element type as second argument. See mi::neuraylib::get_value() for details.

template<class T , Size ROW, Size COL>
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::math::Matrix< T, ROW, COL > &  v 
)

This specialization handles mi::neuraylib::IValue_matrix.

It expects an mi::math::Matrix of matching dimensions and element type as second argument. See mi::neuraylib::get_value() for details.

Note
The conversion between mi::neuraylib::IValue_matrix and mi::math::Matrix is supposed to preserve the memory layout. Since mi::neuraylib::IValue_matrix uses a column-major layout and mi::math::Matrix uses a row-major layout, the conversion process effectively transposes the matrix.
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::math::Color v 
)
inline

This specialization handles mi::neuraylib::IValue_color.

It expects an mi::math::Color as second argument. See mi::neuraylib::get_value() for details.

mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::math::Spectrum v 
)
inline

This specialization handles mi::neuraylib::IValue_color.

It expects an mi::math::Spectrum as second argument. See mi::neuraylib::get_value() for details.

template<class T >
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
mi::Size  index,
T &  v 
)

This variant handles elements of compounds identified via an additional index.

Parameters
valueThe instance of mi::neuraylib::IValue to read.
indexThe index of the affected compound element.
vThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.
  • -3: The index is not valid.
template<class T >
mi::Sint32 mi::neuraylib::get_value ( const mi::neuraylib::IValue value,
const char *  name,
T &  v 
)

This variant handles fields of structs identified via an additional field name.

Parameters
valueThe instance of mi::neuraylib::IValue to read.
nameThe name of the affected struct field.
vThe new value will be stored here.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.
  • -3: The field name is not valid.
template<class T >
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const T &  v 
)

Simplifies setting the value of mi::neuraylib::IValue from the corresponding classes from the base and math API.

Parameters
valueThe instance of mi::neuraylib::IValue to modify.
vThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.
  • -2: The value of v is not valid.

This general template handles mi::neuraylib::IValue_int and mi::neuraylib::IValue_enum and expects mi::Uint32 as second argument. Since it is a template it will handle other types as second argument if they are accepted in place of parameters of type mi::Uint32, e.g., mi::Sint32.

mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const bool &  v 
)
inline

This specialization handles mi::neuraylib::IValue_bool.

It expects a bool as second argument. See mi::neuraylib::set_value() for details.

mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::Float32 v 
)
inline

This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double.

It expects an mi::Float32 as second argument. See mi::neuraylib::set_value() for details.

mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::Float64 v 
)
inline

This specialization handles mi::neuraylib::IValue_float and mi::neuraylib::IValue_double.

It expects an mi::Float64 as second argument. See mi::neuraylib::set_value() for details.

mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const char *  v 
)
inline

This specialization handles mi::neuraylib::IValue_enum, mi::neuraylib::IValue_string and mi::neuraylib::IValue_resource.

It expects a const char* as second argument. See mi::neuraylib::set_value() for details.

template<class T , Size DIM>
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::math::Vector< T, DIM > &  v 
)

This specialization handles mi::neuraylib::IValue_vector.

It expects an mi::math::Vector of matching dimension and element type as second argument. See mi::neuraylib::set_value() for details.

template<class T , Size ROW, Size COL>
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::math::Matrix< T, ROW, COL > &  v 
)

This specialization handles mi::neuraylib::IValue_matrix.

It expects an mi::math::Matrix of matching dimensions and element type as second argument. See mi::neuraylib::set_value() for details.

Note
The conversion between mi::neuraylib::IValue_matrix and mi::math::Matrix is supposed to preserve the memory layout. Since mi::neuraylib::IValue_matrix uses a column-major layout and mi::math::Matrix uses a row-major layout, the conversion process effectively transposes the matrix.
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::math::Color v 
)
inline

This specialization handles mi::neuraylib::IValue_color.

It expects an mi::math::Color as second argument. See mi::neuraylib::set_value() for details.

mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const mi::math::Spectrum v 
)
inline

This specialization handles mi::neuraylib::IValue_color.

It expects an mi::math::Spectrum as second argument. See mi::neuraylib::set_value() for details.

template<class T >
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
mi::Size  index,
const T &  v 
)

This variant handles elements of compounds identified via an additional index.

Parameters
valueThe instance of mi::neuraylib::IValue to modify.
indexThe index of the affected compound element.
vThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.
  • -3: The index is not valid.
template<class T >
mi::Sint32 mi::neuraylib::set_value ( mi::neuraylib::IValue value,
const char *  name,
const T &  v 
)

This variant handles fields of structs identified via an additional field name.

Parameters
valueThe instance of mi::neuraylib::IValue to modify.
nameThe name of the affected struct field.
vThe new value to be set.
Returns
  • 0: Success.
  • -1: The dynamic type of value does not match the static type of v.
  • -3: The field name is not valid.