Material Merger

5 votes
Date Updated: 
Author Name: 
Shawn Olson

The Material Merger was a script I wrote to help speed up the process of merging multiple materials from any number of objects into single output materials. It will composite and flatten all maps of the materials.

The problem this solves is when you Render To Texture an object that has the Multi/Sub-Object Material or if you RTT a collection of objects that share the same UVW layout... instead of all the maps getting composited into single maps, RTT will render as many maps per map channel as there are materials with that map... so if you RTT an object with a MultiMaterial that has ten materials... you might get ten separate diffuse, ten separate spec, etc.

Who wants to then go open those bitmaps in Photoshop and composite them, then bring back new maps and make new materials?

This tool will let you flatten them into a single map per map channel (1 diffuse, 1 spec, etc) and apply them to a single material.

Currently, the supported materials are:

* Standard
* Multi/Sub-Object
* Shell
* DirectX_Shader
* VRay Material (experimental)

For the Shell Material, the tool will collect/composite the Baked Material, and for the DirectX_Shader, the tool will collect/composite the Render Material.

I know there are already similar solutions out there like the ones in RTTAssist and Flatiron. Both RTTAssist and Flatiron go beyond the scope of what I ususally do and don't really work specifically how I want; so this script is to accomodate my own general need. I highly recommend RTTAssist for anyone needing its array of features... and I have tested Flatiron which also has its own merits.

Documentation on Material Merger is here.

Additional Info: 

Material Merger 1.1

Version 1.2:

* Added Material Shader Type menu to choose the output material Shader Type.

* Added more texture maps to look for.

* Added experimental support for VRay Materials.

* Added minor error checking logic.

Version 1.1:

* Added Open button to open the output directory.

* Updated the Channel spinner to get remembered between sessions.

* Updated file writing to allow for base names with slashes... the output files will get put into subfolders.

* Changed naming of materials. Now the flattened material will match exactly the Base Name.

* Bitmap nodes now also get the Base Name as the node name.

* Added Shell checkbox. When checked, the Assign Flattened button will preserve the exisitng selections' materials but move them into the original material of a Shell Material. The flattened material is assigned to the shell material's Baked Material slot.

Version Requirement: 
3ds Max 2009+
Video URL: