Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IMdl_compiler Class Referenceabstract

The MDL compiler allows to import and export .mdl files, to examine their contents, to create a compiled representation of these via a backend, and to export image canvases, light profiles and measured BSDF data. More...

Inheritance diagram for mi::neuraylib::IMdl_compiler:
mi::base::Interface_declare< 0x8fff0a2d, 0x7df7, 0x4552, 0x92, 0xf7, 0x36, 0x1d, 0x31, 0xc6, 0x30, 0x08 > mi::base::IInterface

Public Member Functions

General configuration
virtual void set_logger (base::ILogger *logger)=0
 Sets the logger. More...
 
virtual base::ILoggerget_logger ()=0
 Returns the used logger. More...
 
virtual Sint32 load_plugin_library (const char *path)=0
 Loads a plugin library. More...
 
Module paths
virtual Sint32 add_module_path (const char *path)=0
 Adds a path to the list of paths to search for MDL modules. More...
 
virtual Sint32 remove_module_path (const char *path)=0
 Removes a path from the list of paths to search for MDL modules. More...
 
virtual void clear_module_paths ()=0
 Clears the list of paths to search for MDL modules. More...
 
virtual Size get_module_paths_length () const =0
 Returns the number of paths to search for MDL modules. More...
 
virtual const IStringget_module_path (Size index) const =0
 Returns the index -th path to search for MDL modules. More...
 
Resource paths
virtual Sint32 add_resource_path (const char *path)=0
 Adds a path to the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements. More...
 
virtual Sint32 remove_resource_path (const char *path)=0
 Removes a path from the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements. More...
 
virtual void clear_resource_paths ()=0
 Clears the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements. More...
 
virtual Size get_resource_paths_length () const =0
 Returns the number of paths to search for resources, i.e., textures, light profiles, and BSDF measurements. More...
 
virtual const IStringget_resource_path (Size index) const =0
 Returns the index -th path to search for resources, i.e., textures, light profiles, and BSDF measurements. More...
 
Import/export
virtual Sint32 deprecated_load_module (ITransaction *transaction, const char *module_name, const IMap *options)=0
 Loads an MDL module from disk (or a builtin module) into the database. More...
 
virtual Sint32 load_module (ITransaction *transaction, const char *module_name, IMdl_execution_context *context=0)=0
 Loads an MDL module from disk (or a builtin module) into the database. More...
 
virtual const char * get_module_db_name (ITransaction *transaction, const char *module_name, IMdl_execution_context *context=0)=0
 Gets the database name of a loaded module. More...
 
virtual Sint32 deprecated_load_module_from_string (ITransaction *transaction, const char *module_name, const char *module_source, const IMap *options)=0
 Loads an MDL module from memory into the database. More...
 
virtual Sint32 load_module_from_string (ITransaction *transaction, const char *module_name, const char *module_source, IMdl_execution_context *context=0)=0
 Loads an MDL module from memory into the database. More...
 
virtual Sint32 add_builtin_module (const char *module_name, const char *module_source)=0
 Adds a builtin MDL module. More...
 
virtual Sint32 deprecated_export_module (ITransaction *transaction, const char *module_name, const char *filename, const IMap *options)=0
 Exports an MDL module from the database to disk. More...
 
virtual Sint32 export_module (ITransaction *transaction, const char *module_name, const char *filename, IMdl_execution_context *context=0)=0
 Exports an MDL module from the database to disk. More...
 
virtual Sint32 deprecated_export_module_to_string (ITransaction *transaction, const char *module_name, IString *exported_module, const IMap *options)=0
 Exports an MDL module from the database to string. More...
 
virtual Sint32 export_module_to_string (ITransaction *transaction, const char *module_name, IString *exported_module, IMdl_execution_context *context=0)=0
 Exports an MDL module from the database to string. More...
 
virtual Sint32 export_canvas (const char *filename, const ICanvas *canvas, Uint32 quality=100) const =0
 Exports a canvas to a file on disk. More...
 
virtual Sint32 export_lightprofile (const char *filename, const ILightprofile *lightprofile) const =0
 Exports a light profile to disk. More...
 
virtual Sint32 export_bsdf_data (const char *filename, const IBsdf_isotropic_data *reflection, const IBsdf_isotropic_data *transmission) const =0
 Exports BSDF data to a file on disk. More...
 
Convenience
virtual const IStringuvtile_marker_to_string (const char *marker, Sint32 u, Sint32 v) const =0
 Resolves a string containing a UDIM/uv-tile marker and a corresponding u,v pair to a pattern as used in the filename of a UDIM/uv-tile sequence. More...
 
virtual const IStringuvtile_string_to_marker (const char *str, const char *marker) const =0
 Replaces the pattern describing the tile index of a UDIM/uv-tile image sequence by the given marker, if the pattern exists in the string. More...
 

Backends

enum  Mdl_backend_kind {
  MB_CUDA_PTX,
  MB_LLVM_IR,
  MB_GLSL,
  MB_NATIVE,
  MB_HLSL
}
 Currently available MDL backends. More...
 
virtual IMdl_backendget_backend (Mdl_backend_kind kind)=0
 Returns an MDL backend generator. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x8fff0a2d, 0x7df7, 0x4552, 0x92, 0xf7, 0x36, 0x1d, 0x31, 0xc6, 0x30, 0x08 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8fff0a2d, 0x7df7, 0x4552, 0x92, 0xf7, 0x36, 0x1d, 0x31, 0xc6, 0x30, 0x08 >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

The MDL compiler allows to import and export .mdl files, to examine their contents, to create a compiled representation of these via a backend, and to export image canvases, light profiles and measured BSDF data.

It also allows to load plugins to add support for loading and exporting images and videos.

Member Enumeration Documentation

Currently available MDL backends.

Enumerator
MB_CUDA_PTX 

Generate CUDA PTX code.

MB_LLVM_IR 

Generate LLVM IR (LLVM 7.0 compatible).

MB_GLSL 

Generate GLSL code .

MB_NATIVE 

Generate native code.

MB_HLSL 

Generate HLSL code .

Member Function Documentation

virtual Sint32 mi::neuraylib::IMdl_compiler::add_builtin_module ( const char *  module_name,
const char *  module_source 
)
pure virtual

Adds a builtin MDL module.

Builtin modules allow to use the native() annotation which is not possible for regular modules. Builtin modules can only be added before the first regular module has been loaded.

Note
After adding a builtin module it is still necessary to load it using load_module() before it can actually be used.
Parameters
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::").
module_sourceThe MDL source code of the module.
Returns
  • 0: Success.
  • -1: Possible failure reasons: invalid parameters (NULL pointer), module_name is not a valid module name, failure to compile the module, or a regular module has already been loaded.
virtual Sint32 mi::neuraylib::IMdl_compiler::add_module_path ( const char *  path)
pure virtual

Adds a path to the list of paths to search for MDL modules.

This search path is also used for resources referenced in MDL modules. By default, the list of MDL paths contains "." as sole entry.

Parameters
pathThe path to be added.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Invalid path.
virtual Sint32 mi::neuraylib::IMdl_compiler::add_resource_path ( const char *  path)
pure virtual

Adds a path to the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements.

Note that for MDL resources referenced in .mdl files the MDL search paths are considered, not the resource search paths. By default, the list of resource paths contains "." as sole entry.

Parameters
pathThe path to be added.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Invalid path.
virtual void mi::neuraylib::IMdl_compiler::clear_module_paths ( )
pure virtual

Clears the list of paths to search for MDL modules.

This search path is also used for resources referenced in MDL modules. By default, the list of MDL paths contains "." as sole entry.

virtual void mi::neuraylib::IMdl_compiler::clear_resource_paths ( )
pure virtual

Clears the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements.

Note that for MDL resources referenced in .mdl files the MDL search paths are considered, not the resource search paths. By default, the list of resource paths contains "." as sole entry.

virtual Sint32 mi::neuraylib::IMdl_compiler::deprecated_export_module ( ITransaction transaction,
const char *  module_name,
const char *  filename,
const IMap options 
)
pure virtual

Exports an MDL module from the database to disk.

The following options are supported:

  • "bundle_resources" of type mi::IBoolean: If true, referenced resources are exported into the same directory as the module, even if they can be found via the module search path.
Parameters
transactionThe transaction to be used.
module_nameThe DB name of the MDL module to export.
filenameThe name of the file to be used for the export.
optionsOptions to control the behavior of the exporter, or NULL.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Failed to open filename for write operations.
  • -6002: There is no MDL module in the database of the given name.
  • -6003: The export failed for unknown reasons.
  • -6004: The MDL module can not be exported since it is a builtin module.
  • -6005: The MDL module can not be exported since filename does not result in a valid MDL identifier.
  • -6010: Incorrect type for a referenced resource.
  • -6013: The export of a file-based resource failed.
  • -6014: The export of a memory-based resource failed.
  • -6016: The export of an archive-based resource failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::deprecated_export_module_to_string ( ITransaction transaction,
const char *  module_name,
IString exported_module,
const IMap options 
)
pure virtual

Exports an MDL module from the database to string.

Parameters
transactionThe transaction to be used.
module_nameThe DB name of the MDL module to export.
exported_moduleThe exported module source code is written to this string.
optionsOptions to control the behavior of the exporter, or NULL.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -6002: There is no MDL module in the database of the given name.
  • -6003: The export failed for unknown reasons.
  • -6004: The MDL module can not be exported since it is a builtin module.
  • -6006: The option bundle_resources is not supported for string-based exports.
  • -6010: Incorrect type for a referenced resource.
  • -6011: The export of file-based resources is not supported for string-based exports.
  • -6012: The export of memory-based resources is not supported for string-based exports.
  • -6013: The export of a file-based resource failed.
  • -6014: The export of a memory-based resource failed.
  • -6015: The export of archive-based resources is not supported for string-based exports.
  • -6016: The export of an archive-based resource failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::deprecated_load_module ( ITransaction transaction,
const char *  module_name,
const IMap options 
)
pure virtual

Loads an MDL module from disk (or a builtin module) into the database.

The module is located on disk according to the module search paths (see add_module_path()), loaded, and compiled. If successful, the method creates DB elements for the module and all its imported modules, as well as for all material and function definitions contained in these modules.

The method can also be for builtin modules for which the first step, locating the module on disk, is skipped.

Parameters
transactionThe transaction to be used.
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::").
optionsOptions to control the behavior of the importer, or NULL.
Returns
  • 1: Success (module exists already, loading from file was skipped).
  • 0: Success (module was actually loaded from file or is a builtin module).
  • -1: The module name module_name is invalid or a NULL pointer.
  • -2: Failed to find or to compile the module module_name.
  • -3: The DB name for an imported module is already in use but is not an MDL module, or the DB name for a definition in this module is already in use.
  • -4: Initialization of an imported module failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::deprecated_load_module_from_string ( ITransaction transaction,
const char *  module_name,
const char *  module_source,
const IMap options 
)
pure virtual

Loads an MDL module from memory into the database.

The provided module source is compiled. If successful, the method creates DB elements for the module and all its imported modules, as well as for all material and function definitions contained in these modules.

Parameters
transactionThe transaction to be used.
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::").
module_sourceThe MDL source code of the module.
optionsOptions to control the behavior of the importer, or NULL.
Returns
  • 1: Success (module exists already, creating from module_source was skipped).
  • 0: Success (module was actually created from module_source).
  • -1: The module name module_name is invalid, or module_name or module_source is a NULL pointer.
  • -2: Shadows a file-based module or failed to compile the module module_name.
  • -3: The DB name for an imported module is already in use but is not an MDL module, or the DB name for a definition in this module is already in use.
  • -4: Initialization of an imported module failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::export_bsdf_data ( const char *  filename,
const IBsdf_isotropic_data reflection,
const IBsdf_isotropic_data transmission 
) const
pure virtual

Exports BSDF data to a file on disk.

Parameters
filenameThe file name of the resource to export the BSDF measurement to.
reflectionThe BSDF data for reflection to export. Can be NULL.
transmissionThe BSDF data for transmission to export. Can be NULL.
Returns
  • 0: Success.
  • -1: Invalid file name.
  • -4: Unspecified failure.
virtual Sint32 mi::neuraylib::IMdl_compiler::export_canvas ( const char *  filename,
const ICanvas canvas,
Uint32  quality = 100 
) const
pure virtual

Exports a canvas to a file on disk.

If the image plugin that is selected for the export based on the filename parameter is not capable of handling the pixel type of canvas, the canvas is internally converted into one of the pixel types supported by that image plugin for export. If the image plugin supports multiple pixel types for export, the "best" of them (w.r.t. the pixel type of the canvas) is chosen.

The "best" pixel type is determined by attempting to apply the following conversions in the given order to the pixel type of the canvas:

  • use an equivalent pixel type ("Color" instead of "Float32<4>" and vice versa, similar for "Rgb_fp" / "Float32<3>" and "Rgba" / "Sint32"),
  • add an alpha channel (if not already present),
  • increase bits per channel (smaller increase preferred),
  • add additional channels (if possible),
  • decrease bits per channel (smaller decrease preferred), and
  • drop one or more channels.
Parameters
filenameThe file name of the resource to export the canvas to. The ending of the file name determines the image format, e.g., ".jpg". Note that support for a given image format requires an image plugin capable of handling that format.
canvasThe canvas to export.
qualityThe compression quality is an integer in the range from 0 to 100, where 0 is the lowest quality, and 100 is the highest quality.
Returns
  • 0: Success.
  • -1: Invalid URI.
  • -2: Invalid canvas.
  • -3: Invalid quality.
  • -4: Unspecified failure.
virtual Sint32 mi::neuraylib::IMdl_compiler::export_lightprofile ( const char *  filename,
const ILightprofile lightprofile 
) const
pure virtual

Exports a light profile to disk.

Parameters
filenameThe file name of the resource to export the light profile to.
lightprofileThe light profile to export.
Returns
  • 0: Success.
  • -1: Invalid file name.
  • -2: Invalid light profile.
  • -4: Unspecified failure.
virtual Sint32 mi::neuraylib::IMdl_compiler::export_module ( ITransaction transaction,
const char *  module_name,
const char *  filename,
IMdl_execution_context context = 0 
)
pure virtual

Exports an MDL module from the database to disk.

The following options are supported:

  • "bundle_resources" of type mi::IBoolean: If true, referenced resources are exported into the same directory as the module, even if they can be found via the module search path.
Parameters
transactionThe transaction to be used.
module_nameThe DB name of the MDL module to export.
filenameThe name of the file to be used for the export.
contextThe execution context can be used to pass options to control the behavior of the MDL compiler. During module loading, compiler messages like errors or warnings are stored in the context. Can be NULL.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Failed to open filename for write operations.
  • -6002: There is no MDL module in the database of the given name.
  • -6003: The export failed for unknown reasons.
  • -6004: The MDL module can not be exported since it is a builtin module.
  • -6005: The MDL module can not be exported since filename does not result in a valid MDL identifier.
  • -6010: Incorrect type for a referenced resource.
  • -6013: The export of a file-based resource failed.
  • -6014: The export of a memory-based resource failed.
  • -6016: The export of an archive-based resource failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::export_module_to_string ( ITransaction transaction,
const char *  module_name,
IString exported_module,
IMdl_execution_context context = 0 
)
pure virtual

Exports an MDL module from the database to string.

Parameters
transactionThe transaction to be used.
module_nameThe DB name of the MDL module to export.
exported_moduleThe exported module source code is written to this string.
contextThe execution context can be used to pass options to control the behavior of the MDL compiler. During module loading, compiler messages like errors or warnings are stored in the context. Can be NULL.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -6002: There is no MDL module in the database of the given name.
  • -6003: The export failed for unknown reasons.
  • -6004: The MDL module can not be exported since it is a builtin module.
  • -6006: The option bundle_resources is not supported for string-based exports.
  • -6010: Incorrect type for a referenced resource.
  • -6011: The export of file-based resources is not supported for string-based exports.
  • -6012: The export of memory-based resources is not supported for string-based exports.
  • -6013: The export of a file-based resource failed.
  • -6014: The export of a memory-based resource failed.
  • -6015: The export of archive-based resources is not supported for string-based exports.
  • -6016: The export of an archive-based resource failed.
virtual IMdl_backend* mi::neuraylib::IMdl_compiler::get_backend ( Mdl_backend_kind  kind)
pure virtual

Returns an MDL backend generator.

Parameters
kindThe desired backend generator.
Returns
The backend generator, or NULL if the requested backend is not available.
virtual base::ILogger* mi::neuraylib::IMdl_compiler::get_logger ( )
pure virtual

Returns the used logger.

Returns
The currently used logger (either explicitly installed via set_logger(), or the the default logger). Never returns NULL.
virtual const char* mi::neuraylib::IMdl_compiler::get_module_db_name ( ITransaction transaction,
const char *  module_name,
IMdl_execution_context context = 0 
)
pure virtual

Gets the database name of a loaded module.

After successfully loading a module using load_module() or load_module_from_string() it is often required to query the module or contained elements from the database. Therefore, the database name is required, which is returned by this method.

While for MDL modules the database name can be computed by simply pre-pending the prefix "mdl::" to the fully qualified module name, for MDLE, obtaining the database name is more involved: here, the DB name contains the absolute, normalized file path of the MDLE file. Normalized means that there are no occurrences of '../' and '/' is used as path separator, independent of the platform. Furthermore must the normalized path start with a leading forward slash, which has to be added in case there is none already.

Parameters
transactionThe transaction to be used for checking if the module is loaded.
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::") or an MDLE filename (absolute or relative to the current working directory).
contextThe execution context can be used to pass options to control the behavior of the MDL compiler. Messages like errors or warnings are also stored in the context. Can be NULL.
Returns
The database name of the module that was loaded using the provided module_name. NULL in case the module was not found or the provided module_name was not a valid module name.
virtual const IString* mi::neuraylib::IMdl_compiler::get_module_path ( Size  index) const
pure virtual

Returns the index -th path to search for MDL modules.

This search path is also used for resources referenced in MDL modules. By default, the list of MDL paths contains "." as sole entry.

Returns
The index -th path, or NULL if index is out of bounds.
virtual Size mi::neuraylib::IMdl_compiler::get_module_paths_length ( ) const
pure virtual

Returns the number of paths to search for MDL modules.

This search path is also used for resources referenced in MDL modules. By default, the list of MDL paths contains "." as sole entry.

Returns
The number of currently configured paths.
virtual const IString* mi::neuraylib::IMdl_compiler::get_resource_path ( Size  index) const
pure virtual

Returns the index -th path to search for resources, i.e., textures, light profiles, and BSDF measurements.

Note that for MDL resources referenced in .mdl files the MDL search paths are considered, not the resource search paths. By default, the list of resource paths contains "." as sole entry.

Returns
The index -th path, or NULL if index is out of bounds.
virtual Size mi::neuraylib::IMdl_compiler::get_resource_paths_length ( ) const
pure virtual

Returns the number of paths to search for resources, i.e., textures, light profiles, and BSDF measurements.

Note that for MDL resources referenced in .mdl files the MDL search paths are considered, not the resource search paths. By default, the list of resource paths contains "." as sole entry.

Returns
The number of currently configured paths.
virtual Sint32 mi::neuraylib::IMdl_compiler::load_module ( ITransaction transaction,
const char *  module_name,
IMdl_execution_context context = 0 
)
pure virtual

Loads an MDL module from disk (or a builtin module) into the database.

The module is located on disk according to the module search paths (see add_module_path()), loaded, and compiled. If successful, the method creates DB elements for the module and all its imported modules, as well as for all material and function definitions contained in these modules.

The method can also be used for builtin modules for which the first step, locating the module on disk, is skipped.

Parameters
transactionThe transaction to be used.
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::") or an MDLE filepath (absolute or relative to the current working directory).
contextThe execution context can be used to pass options to control the behavior of the MDL compiler. The following options are supported by this operation:
  • string "internal_space" = "coordinate_object"|"coordinate_world" (default = "coordinate_world") During module loading, compiler messages like errors or warnings are stored in the context. Can be NULL.
Returns
  • 1: Success (module exists already, loading from file was skipped).
  • 0: Success (module was actually loaded from file or is a builtin module).
  • -1: The module name module_name is invalid or a NULL pointer.
  • -2: Failed to find or to compile the module module_name.
  • -3: The DB name for an imported module is already in use but is not an MDL module, or the DB name for a definition in this module is already in use.
  • -4: Initialization of an imported module failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::load_module_from_string ( ITransaction transaction,
const char *  module_name,
const char *  module_source,
IMdl_execution_context context = 0 
)
pure virtual

Loads an MDL module from memory into the database.

The provided module source is compiled. If successful, the method creates DB elements for the module and all its imported modules, as well as for all material and function definitions contained in these modules.

Parameters
transactionThe transaction to be used.
module_nameThe fully-qualified MDL name of the MDL module (including package names, starting with "::").
module_sourceThe MDL source code of the module.
contextThe execution context can be used to pass options to control the behavior of the MDL compiler. The following options are supported by this operation:
  • string "internal_space" = "coordinate_object"|"coordinate_world" (default = "coordinate_world") During module loading, compiler messages like errors or warnings are stored in the context. Can be NULL.
Returns
  • 1: Success (module exists already, creating from module_source was skipped).
  • 0: Success (module was actually created from module_source).
  • -1: The module name module_name is invalid, or module_name or module_source is a NULL pointer.
  • -2: Shadows a file-based module or failed to compile the module module_name.
  • -3: The DB name for an imported module is already in use but is not an MDL module, or the DB name for a definition in this module is already in use.
  • -4: Initialization of an imported module failed.
virtual Sint32 mi::neuraylib::IMdl_compiler::load_plugin_library ( const char *  path)
pure virtual

Loads a plugin library.

This function loads the specified shared library, enumerates all plugin classes in the specified shared library, and adds them to the system.

This function can only be called before the MDL API has been started.

Parameters
pathThe path of the shared library to be loaded.
Returns
0, in case of success, -1 in case of failure.
virtual Sint32 mi::neuraylib::IMdl_compiler::remove_module_path ( const char *  path)
pure virtual

Removes a path from the list of paths to search for MDL modules.

This search path is also used for resources referenced in MDL modules. By default, the list of MDL paths contains "." as sole entry.

Parameters
pathThe path to be removed.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no such path in the path list.
virtual Sint32 mi::neuraylib::IMdl_compiler::remove_resource_path ( const char *  path)
pure virtual

Removes a path from the list of paths to search for resources, i.e., textures, light profiles, and BSDF measurements.

Note that for MDL resources referenced in .mdl files the MDL search paths are considered, not the resource search paths. By default, the list of resource paths contains "." as sole entry.

Parameters
pathThe path to be removed.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no such path in the path list.
virtual void mi::neuraylib::IMdl_compiler::set_logger ( base::ILogger logger)
pure virtual

Sets the logger.

Installs a custom logger, and deinstalls the previously installed logger. By default, an internal logger is installed that prints all messages of severity mi::base::MESSAGE_SEVERITY_INFO or higher to stderr.

Parameters
loggerThe new logger that receives all log messages. Passing NULL is allowed to reinstall the default logger.
virtual const IString* mi::neuraylib::IMdl_compiler::uvtile_marker_to_string ( const char *  marker,
Sint32  u,
Sint32  v 
) const
pure virtual

Resolves a string containing a UDIM/uv-tile marker and a corresponding u,v pair to a pattern as used in the filename of a UDIM/uv-tile sequence.

Parameters
markerstring containing a valid MDL UDIM/uv-tile marker.
uuv-tile position in u-direction
vuv-tile position in v-direction
Returns
a string containing the resolved pattern.
virtual const IString* mi::neuraylib::IMdl_compiler::uvtile_string_to_marker ( const char *  str,
const char *  marker 
) const
pure virtual

Replaces the pattern describing the tile index of a UDIM/uv-tile image sequence by the given marker, if the pattern exists in the string.

Parameters
strstring containing the pattern, e.g. _u1_v1
markerthe marker to replace the pattern with
Returns
string with marker or NULL, if a corresponding pattern could not be found.