Python for Material Library Texture Usage
Hi, to All.
I'm fairly new to Blender and I'm building a library of textures for a set of Daz assets I commonly use. Because I'm into non photo realistic renders (NPR), I create custom cel shaded textures as I go along. Lately I dscovered the Blender add-on called Material Library. I found this add-on very useful for collecting and saving textures as external files. To improve my workflow, the next logical step is to take these textures and apply them automatically by means of Python scripts.
Not knowing much about Python in Blender, my question is: can this be done? Has anyone written scripts to map textures stored in Material Library to the surfaces of a model in Blender? Any tips would be much appreciated.
Thanks!
Comments
I've never done it, but I do know you can enable "Python Tooltips" and the API functions will appear when you hover over a command. You can use that to easily figure out how to script what you want to do.
@csaa
I primarily use Alembic to export to Blender, which doesn't support materials at all, so this was a problem I faced very early on. Take a look at these scripts. I admit that it's rather brittle, i.e. if the order of the slots changes you have to adjust the map file, but I seldom do that.
Change the file extentions from .txt to .py
@TheMysteryIsThePoint,
Thanks for the code! I'll try it out.
Cheers!
@margrave,
The tooltip exposing the Python API will come in handy. Thanks for the suggestion.
Cheers!