MaterialX Python API Documentation

The MaterialX Python API provides Python bindings for the MaterialX C++ API .

MaterialX is an open standard for representing rich material and look-development content in computer graphics, enabling its platform-independent description and exchange across applications and renderers. Launched at Industrial Light & Magic in 2012, MaterialX has been a key technology in their feature films and real-time experiences since Star Wars: The Force Awakens and Millennium Falcon: Smugglers Run. The project was released as open source in 2017, with companies including Sony Pictures Imageworks, Pixar, Autodesk, Adobe, and SideFX contributing to its ongoing development. In 2021, MaterialX became the seventh hosted project of the Academy Software Foundation .

MaterialX Python API

The MaterialX Python API consists of two parts:

The MaterialX Python package is typically imported aliased as mx:

import MaterialX as mx

All functions and classes from the PyMaterialXCore and PyMaterialXFormat modules are available in the top-level MaterialX namespace, and, by aliasing, the mx namespace.

For example, the PyMaterialXCore.Matrix44 class is typically used as mx.Matrix44:

>>> import MaterialX as mx
>>> mx.Matrix44
<class 'MaterialX.PyMaterialXCore.Matrix44'>

You can use the Quick search box in the sidebar on the left to quickly find documentation for a particular module, function, class, method, or attribute of interest, for example getUdimCoordinates or MeshPartition.

MaterialX Python Modules

PyMaterialXCore

Core MaterialX elements and graph traversal.

PyMaterialXFormat

Cross-platform support for document serialization and file utilities.

PyMaterialXGenShader

Core shader generation support for MaterialX.

PyMaterialXGenGlsl

Shader generation using the OpenGL Shading Language.

PyMaterialXGenOsl

Shader generation using Open Shading Language.

PyMaterialXGenMdl

Shader generation using the Material Definition Language.

PyMaterialXGenMsl

Shader generation using the Metal Shading Language.

PyMaterialXRender

Core rendering support for MaterialX.

PyMaterialXRenderGlsl

Rendering support for the OpenGL Shading Language.

PyMaterialXRenderOsl

Rendering support for Open Shading Language.

PyMaterialXRenderMsl

Rendering support for the Metal Shading Language.