Enumerations | Functions
MaterialX API

MaterialX document processing. More...

Enumerations

enum  AtMaterialxErrorCode { AI_MATX_SUCCESS, AI_MATX_ERROR_LOAD_DOCUMENT, AI_MATX_ERROR_NO_MATERIALS }
 MaterialX error codes. More...
 

Functions

AI_API int AiMaterialxWrite (const AtUniverse *universe, const char *filename, const char *look_name, const char *properties=NULL, bool relative=true)
 Generate and write a MaterialX document to a file from an Arnold scene. More...
 
AI_API int AiMaterialxWriteMaterial (const char *filename, const char *material_name, const AtNode *surface=NULL, const AtNode *volume=NULL, const AtNode *displacement=NULL)
 
AI_API AtArray * AiMaterialxGetLookNames (const char *filename)
 Get a list of look names in a MaterialX document. More...
 
AI_API AtArray * AiMaterialxGetMaterialNames (const char *filename)
 Get a list of material names in a MaterialX document. More...
 
AI_API int AiMaterialxReadMaterials (AtUniverse *universe, const char *filename, const AtParamValueMap *params=NULL, AtArray *nodes=NULL)
 Populates an Arnold universe with materials in a MaterialX document. More...
 

Detailed Description

MaterialX document processing.

This API acts as a bridge between the Arnold and MaterialX data models. For instance, materials and looks in an Arnold universe can be written to a MaterialX document, and vice versa.

Other utility functions can be used to introspect and query elements in a MaterialX document such as look and material names.

Enumeration Type Documentation

MaterialX error codes.

Enumerator
AI_MATX_SUCCESS 

no error

AI_MATX_ERROR_LOAD_DOCUMENT 

error loading the document

AI_MATX_ERROR_NO_MATERIALS 

no materials found

Function Documentation

AI_API int AiMaterialxWrite ( const AtUniverse universe,
const char *  filename,
const char *  look_name,
const char *  properties,
bool  relative 
)

Generate and write a MaterialX document to a file from an Arnold scene.

Parameters
universeuniverse whose contents will be written to a .mtlx document (NULL for default universe)
filenameoutput filename
look_nameoutput look name that will be created/appended
propertiesa list of parameter names to include in the property assignments, where the string is expected to follow the materialx comma-separated convention (spaces are ignored)
relativeif true, the assignments for nodes will be relative to their top-most parent node
Returns
0 if the file was written succesfully, -1 otherwise
AI_API AtArray* AiMaterialxGetLookNames ( const char *  filename)

Get a list of look names in a MaterialX document.

Parameters
filenamemtlx document filename
Returns
string array containing the look names, must be freed with AiArrayDestroy
AI_API AtArray* AiMaterialxGetMaterialNames ( const char *  filename)

Get a list of material names in a MaterialX document.

Parameters
filenamemtlx document filename
Returns
string array containing the material names, must be freed with AiArrayDestroy
AI_API int AiMaterialxReadMaterials ( AtUniverse universe,
const char *  filename,
const AtParamValueMap *  params,
AtArray *  nodes 
)

Populates an Arnold universe with materials in a MaterialX document.

Parameters
universeuniverse which will be populated with MaterialX materials
filenamemtlx document filename

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com