SamuZai
DavidKahlVFX
DavidKahlVFX

patreon


DK Redshift Material Generator v1.0

Hey folks,

it was about time that I got back to work and create. While I can almost start to release the first chapter of the rail I managed to get deeper into python.

At the end of creating the geometry of the train I export alembic files for texturing in substance. The textures are saved into a folder that may contain more then one mesh.

With the export setting in Substance Painter it created 5 textures for each meshgroup. The train cabin alone has 6 groups. That means you would need to create 6 Materials and connect 30 textures by hand. Just for the cabin alone.

I created a PDG setup to create variants of the wagons which means I would need to connect 30 new textures for each variant.

That was no good so I looked into possible solutions. There is a labs node called quickmat which allows to define the shader in its UI and it would create the material accordingly. That was a good start but would still need manual work. Also it did not include Redshift materials.

So I wrote a python module that would go into the folder you point it to and look for the matching meshname. It groups all the textures together, creates all the required nodes and connects the textures all by itself.

I did a quick demonstration in this video

https://youtu.be/GJNe2xeIqzI

The creation of this tool is not part of the rail course but I am sure it might be helpful for redshift users. 

Attached you will find the first version of the tool. Besides the video here is how it works:

1. create a primitive attribute called meshname with the name of the alembic file. Since the files from substance by default are called Meshname_meshgroup_texturename.png

By adding the underscore you can make sure that it is accurate


2.  create the dk rs mat node and it will pull in the meshname from the primitives


3. Simply select the right directory where you have your textures and the tool will do the rest for you. It will directly pull in all paths and immediatly create the nodes.


You get a short print in the console of the groups and textures it found


After that you can, at this point change the selected Textures and Scales foreach meshgroup individually. Each change will overwrite the existing nodes and rebuild them from scratch.

Be aware that if you change the directory or press the "Load Files" button, it will rebuild the paths and sets them all back to default. Changing the textures or their scale or pressing "Generate" also rebuilds the materials but keeps your manual changes you made.

I hope you find this tool useful. If you have any suggestions or feature requests for this tool let me know.

Cheers

Dave

 

DK Redshift Material Generator v1.0

More Creators