ai_materialx.h
Go to the documentation of this file.
1// Copyright 2021 Autodesk, Inc. All rights reserved.
2//
3// Use of this software is subject to the terms of the Autodesk license
4// agreement provided at the time of installation or download, or which
5// otherwise accompanies this software in either electronic or hard copy form.
6
12#pragma once
13
14#include "ai_nodes.h"
15#include "ai_api.h"
16#include "ai_map.h"
17
37{
41};
42
43AI_API int AiMaterialxWrite(const AtUniverse* universe, const char* filename, const char* look_name, const char* properties = NULL, bool relative = true);
44AI_API int AiMaterialxWriteMaterial(const char* filename, const char* material_name, const AtNode* surface = NULL, const AtNode* volume = NULL, const AtNode* displacement = NULL);
45
46AI_API AtArray* AiMaterialxGetLookNames(const char* filename);
47AI_API AtArray* AiMaterialxGetMaterialNames(const char* filename);
48
49AI_API int AiMaterialxReadMaterials(AtUniverse* universe, const char* filename, const AtParamValueMap* params = NULL, AtArray* nodes = NULL);
50AI_API const AtString AiMaterialxGetOslShaderCode(const char* node_definition, const char* shader_name, AtParamValueMap* connected_inputs = nullptr);
51
52/*\}*/
DLL export prefix for API functions (necessary for multi-platform development)
Key/Value storage.
AtNode struct and methods.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
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.
Definition: ai_materialx.cpp:63
AtMaterialxErrorCode
MaterialX error codes.
Definition: ai_materialx.h:37
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.
Definition: ai_materialx.cpp:21
AI_API const AtString AiMaterialxGetOslShaderCode(const char *node_definition, const char *shader_name, AtParamValueMap *connected_inputs=nullptr)
Given a MaterialX node definition, generate its corresponding OSL code as a shader.
Definition: ai_materialx.cpp:77
AI_API AtArray * AiMaterialxGetLookNames(const char *filename)
Get a list of look names in a MaterialX document.
Definition: ai_materialx.cpp:39
AI_API AtArray * AiMaterialxGetMaterialNames(const char *filename)
Get a list of material names in a MaterialX document.
Definition: ai_materialx.cpp:51
@ AI_MATX_ERROR_NO_MATERIALS
no materials found
Definition: ai_materialx.h:40
@ AI_MATX_ERROR_LOAD_DOCUMENT
error loading the document
Definition: ai_materialx.h:39
@ AI_MATX_SUCCESS
no error
Definition: ai_materialx.h:38
This represents a node in Arnold.
This represents a universe in Arnold.

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