This is an automatic .mat loader, it sets up a .mat file into a blender material which you can then apply to a object, currently only works when you move .mat's to the same folder as all the textures
Supports Diffuse, Normal, Specular & Emissive textures
- Download the .py file (or click it, then click raw and ctrl+a -> ctrl+c it)
- Open blender
- Go to the scripting tab, and drag the .py file into the large text box (or paste the code into there from earlier)
-
Once you have it imported into the scripting tab, you should setup your exported .mat and exported .tga textures (you must use tga at the moment)
-
Move the .mat file you want to import to the same folder as the textures (Majority of cosmetics should do this, you can also just drag the textures into the same folder if they are split up, but this is made to deal with the most common case)
-
Copy the full path of the .mat file, this can be done by shift right clicking in windows explorer and clicking "Copy As Path"
-
In the scripting tab in blender, past the full path after "DotMatPath = r", It should look something like:
DotMatPath = r"C:\PathToUmodelEtc\material.mat"
-
There are two other options available:
outputMaterialName
used to determine the output material name, leave blank (outputMaterialName = ""
) to make it name it the same as the fileApplyMaterialToCurrentlySelectedObject
- This one should be pretty self explanatory, make sure you capitilze the first letter inTrue
orFalse
-
Press "Run Script" at the top right
https://i.imgur.com/4OMVs4T.mp4
Created on blender 2.80, other versions not verified.