This Add-on lets you import materials from XML descriptions.
It will create node trees for those materials based around the Principled BSDF node.
To install the Add-on you need Blender in version 2.79 or later.
- Download the Add-on file.
- For Blender 2.8 or newer: pbr-material-importer.py
- For Blender 2.79: pbr-material-importer-v1-2.py
- Install the Add-on by opening the Blender User Preferences and clicking on "Install Add-on from File…" at the bottom of the "Add-ons" tab to provide the file.
- The Add-on will not be enabled automatically. You have to enable it by checking it's check box in the Add-on list before you can use it.
- If you want the Add-on enabled by default every time you start Blender, click on the "Save User Settings" button at the bottom of the "Add-ons" tab.
When importing materials with the same name as already existing ones in your project, a number will be added as a suffix to the imported material names by default.
If instead you want to replace existing materials with the same name, you have the option to check the "Replace existing Materials" check box in the importer dialog:
The basic structure you need to create looks like this:
<?xml version="1.0"?>
<PbrMaterialDescriptions version="1.1">
<Material name="My Material"/>
</PbrMaterialDescriptions>
The following properties can be defined as child elements for materials:
Base_Color
Subsurface
Subsurface_Radius
Subsurface_Color
Metallic
Specular
Specular_Tint
Roughness
Anisotropic
Anisotropic_Rotation
Sheen
Sheen_Tint
Clearcoat
Clearcoat_Roughness
IOR
Transmission
Normal
Bump
Clearcoat_Normal
Tangent
Emission
Opacity
Displacement
For those properties supporting it:
A value for a property can be defined by adding it as an attribute to the property element:
<Base_Color value="(0.72, 0.22, 0.09)"/>
To define an Image Texture Node as input for a property, an "Image" child element can be added to the property element including a "path" attribute pointing to the texture file:
<Image path="./Bricks05/Bricks05_col.jpg"/>
The path must be relative to the XML file or absolute.
For more options and details please refer to the Schema Definition: PbrMaterialDescriptions.xsd
You can find an interactive visual representation of the schema here on visualxsd.com.