MaterialX and USD for 3ds Max
MaterialX is an open-source standard developed by Lucasfilm, intended to facilitate the exchange of materials and lookdev workflows across applications. Materials authored in MaterialX can be used and rendered in various applications and renderers, such as 3ds Max. While the intent of MaterialX is to have a consistent rendering experience across all applications and renderers, note that this standard and its support is continually evolving.
The MaterialX plug-in for 3ds Max is currently bundled with the 3ds Max USD plug-in, as a way to promote cross-DCC workflows via USD.
MaterialX Version |
3ds Max Release |
1.38.4 |
2024 |
1.38.0 |
2023 |
1.38.0 |
2022 |
The bundled MaterialX plug-in has several key features:
- MaterialX Material: This scripted material can load MaterialX files (.mtlx) into the Material Editor. Under the hood, it is actually importing the MaterialX files into a Physical Material composed of an OSL network of textures.
- MaterialX Importer: This utility is used for MaterialX Materials. Note: More features are available in the MtlxIO Utility in the 3ds Max Utilities tab.
- MaterialX Authoring: The plug-in adds an entire category to the OSL maps in Slate that can be used to author MaterialX data.
- MaterialX Exporter: The plug-in can export a Physical Material to MaterialX.
- MAXScript: The MaterialX Importer and Exporter are exposed to MAXScript to allow automation and scripting.
- Integration with USD: The MaterialX plug-in comes with a Shader Writer for the 3ds Max USD Plug-in that will allow the USD export to bind references to the MaterialX files to USD Prims when exporting scenes using a MaterialX Material.
Load a MaterialX File into 3ds Max
The most straightforward method to use MaterialX is to load a MaterialX file into a MaterialX Material.
A. You can find this material in the Material Browser as MaterialX Material.
B. You can also find it in the Materials > General list when right-clicking in a Slate view.
Once loaded, you can click Pick MaterialX file in the Material Editor and browse for a .mtlx
file on your computer.
Tip:
There are several libraries of high-quality materials freely available on the internet, including the open source MaterialX Library from AMD.
The drop-down list in the MaterialX Material section will allow you to switch between different materials within the same MaterialX definition as a MaterialX file can contain multiple materials. However, most files will only list a single material.
Use the following features in the MaterialX Material section to work with your chosen material(s).
- Reload: This button will re-import the current MaterialX file and update the material from the file. This is useful if the file was updated and you need to see the results. This function is run automatically when a scene is loaded.
- Explode Permanently: When this button is pressed, the MaterialX Material is converted to a Physical Material with MaterialX-compliant OSL nodes and display that material in Slate. This will allow you to edit that material within Slate. When pressed, the MaterialX Material is replaced in the scene with the new Physical Material.
- Warning: The current MaterialX Material remains in the material editor until you select a material.
- Open For Edit: Open for Edit will display the current MaterialX Material as a Physical Material with OSL nodes. Changes to this material will reflect in the viewport but will not persist in the scene after the scene closes or you refresh the MaterialX Material. This feature is experimental and for debugging. The function may be removed from future updates.
Material Switcher: A Material Switcher USD writer is available for 3ds Max 2024 and above from the Slate Material Editor > Material Switcher. Once you have materials set to your USD prims, in the exporter dialog, choose from export as variants set (default) which exports all material inputs into material variants and export active material only which only exports the active material and binds it to the prim.
Note: Complex material inputs (such as multimaterials) are unsupported to export as variant sets from the Material Switcher.
The MaterialX Utilities are tools for importing and exporting MaterialX files. You can find in the Command Panel > Utilities Tab > More… > select MtlxIOUtil
.
Importing MaterialX
- Open the
MtlxIOUtil
in the Utilities tab of the command panel.
- Use your desired settings in the Import section.
- Click the Import MaterialX button to browse for a
.mtlx
file.
Exporting MaterialX
Important: You can author MaterialX files by using these rules:
- Use only Physical Materials
- Use only the OSL maps found under MaterialX or the BitmapTexture
- Apply the material or materials you want to objects in the scene.
- Open the
MtlxIOUtil
in the Utilities tab of the command panel.
- Select the objects in the scene that have the materials you want to export.
- Click the Export MaterialX… button.
- Choose a filename.
- Choose your export settings:
- Copy Textures to Save Location: When enabled, bitmaps will be copied to the same location as the .mtlx file. This is useful when distributing a material.
- Use Relative Paths for Textures: When enabled, the path to the textures in the
.mtlx
file will be relative to the .mtlx
file. This is useful when creating sharable assets.
Using MaterialX in USD
One of the main benefits of the MaterialX plug-in is that it allows you to create USD assets that reference and use MaterialX files. To do this, simply use the MaterialX Material on geometry in your scene and turn on the MaterialX option in Materials > Export Materials section of the USD Exporter.
MaterialX Limitations
- When using USDView bundled with 3ds Max 2022 and 2023: if you export or view an existing .usd file with MaterialX data present, the viewport in USDView may turn black and be unusable.
- Loss of parameters when exporting a MaterialX material can occur. Workaround: Edit the MaterialX file's UVs manually using 'Explode Permanently'. However, in this technique, the material becomes an OSL composite representing the MaterialX file rather than a true MaterialX sample.
- USDZ format cannot export MaterialX data as part of the USDZ framework. See USDZ specifications.