LoftyLight's avatar

Lofty's Tools - XNALara to 3DS Max Material Tools

By LoftyLight
187 Favourites
---  LOFTY'S TOOLS  ---

--- DOWNLOAD ---
Version 2.00: [DOWNLOAD]
See the changelog further down. I'll probably make a proper manual or guide/tutorial sometime.

Version 1.00: [DOWNLOAD]


So I made this 3DS Max script file that creates a small toolbox with some functionality I find useful when porting XNALara models into 3DS Max. It can change some common properties on all materials applied to the meshes/objects you currently have selected. The picture you see above took under 3 minutes to set up including import, scaling, positioning and then using my script to fix the transparent materials and make some other basic changes to the materials. I didn't have to open the material editor a single time.


- Fix hair and other materials with transparency with the click of a single button.
- Enable and disable backface culling (2-Sided material option) for all materials on selected objects.
- Merge duplicate materials. (Materials that use the same diffuse and bump textures.)
- Merge meshes that have the same material. Used after merging duplicate materials to combine the meshes into easier to manage ones.
- Weld the vertices in selected objects by threshold. Good for fixing texture seams.
- Remove double faces in meshes. Sometimes happens after welding overlapping meshes.
- Set the bump, specular level and glossiness of all materials on selected objects.
- Convert Standard materials to Arch and Design. Useful for having more advanced control over shiny materials. I use it on eye materials and other things.

--- HOW TO USE ---

1. Click on MAXScript. (It's in the menu at the top.)
2. Click Run Script...
3. Find and run the script file.
4. Select the objects you want to modify the material properties for and click whatever it is you want to do with them.

Example: Select all of your hair objects and click "Set Diffuse and Ambient to Black" and then click  "Fix Hair Transparency" to fix the materials all at once.
Another Example: Select all the skin objects, set specular to 100 and click the specular button. Then click on "Copy Diffuse Map to Specular Map". Makes the skin shine.

New Features Example: Lets say you have a model where the skin is broken up into multiple pieces. Select the skin meshes and click "Merge Duplicate Materials" and then "Merge Meshes With Same Material". The skin meshes are now attached to each other but there might be seams in the texture. With the mesh still selected set the weld threshold to a low value like 0.0001 or 0.001 and click "Weld". Now it is fixed and you can even turbosmooth it or quadrify + turbosmooth.


The script grabs the material from every selected item and performs the following on them depending on the button you click:

Enable 2-Sided - Turns on 2-Sided.

Disable 2-Sided - Turns off 2-Sided.

Set Diffuse and Ambient to Black - Sets diffuse and ambient colours to black.

Fix Hair Transparency - Copies the diffuse map to the opacity map. Sets Mono Channel Output to Alpha. Unchecks Premultipied Alpha. Turns on 2-Sided.

Merge Duplicate Materials - For every material on the selected objects, compares its bump and normal map texture files to every other material and replaces those materials with itself if they are the same.

Merge Meshes With Same Material - Attaches all objects that have the same material to each other. Note: This can create seams which should be fixed using "Weld".

Weld - For each object in the selection, welds it's vertices by the threshold. Fixes texture seams.

Delete Double Faces - Searches through all the faces on selected meshes and removes any duplicates. You can get double faces sometimes if there were two identical meshes that were overlapping that were attached to each other and welded.

Convert to Arch and Design - Creates a new Arch and Design material and copies over the diffuse, specular, glossiness, bump and displacement settings to it. Applies the new material. Note: Materials with transparency (hair etc.) do not work properly with this.

Bump - Sets the bump amount. Works on Arch and Design materials too.

Specular / Reflectivity - Sets the specular level of Standard materials. Sets the reflectivity of Arch and Design materials.

Glossiness - Sets the glossiness. Works on Arch and Design materials too.

Copy Diffuse Map to Specular Map - Does exactly what it says. I find this useful for some things.

Clear Specular Map - Clears the specular map. I use this to undo the effects of "Copy Diffuse Map to Specular Map" sometimes.

Note: Arch and Design bump, specular and glossiness values are divided by 100 so if you set bump to 75, it will actually set bump to 0.75 etc.



- Clicking "Fix Hair Transparency" no longer sets ambient and diffuse colours to black. Use the "Set Diffuse and Ambient to Black" button to do this before or after fixing your hair. I split up the function because some models require you to set the diffuse and ambient to black on materials that should not have the transparency fix run on them.
- Added button to merge duplicate materials based on the material diffuse and bump texture files.
- Added button to merge meshes that have the same material.
- Added button to iterate over your selected meshes and weld each one individually by the threshold.
- Added button to delete double faces. Fixes some problems you can get when you welded overlapping identical meshes. Doesn't work on welded hair so don't weld hair.

--- END NOTES ---

Feel free to use or modify the script and you can credit me if you want. Report any bugs or give suggestions in comments.

Image size
1920x1080px 1.58 MB
© 2015 - 2021 LoftyLight
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In
RinSama3D's avatar
can we use for blender? any way? :D
LoftyLight's avatar
Nope. Only for 3DS Max.
Runemaster-Kiro's avatar
Is there any converter to Maya?
LoftyLight's avatar
I dunno anything about scripting for Maya. You can probably export out of 3DS Max and into Maya.
johny-queen's avatar
why its not working with me ??
whatever i do the hair ends still show as white when rendering ONLY !
i click the fix hair button but when i go render it doesnt fix anything!!!!
^_^am i doing anything wrong here?

edit: NEVER MIND it worked ! thanks for the amazing tool 
Ditster's avatar
Thanks. Its really helpful...
LoftyLight's avatar
No problem. Glad you found it helpful.
ZeroReyko's avatar
Thanks for the Tool Bro Wink/Razz Nod 
centity's avatar
I just tried this, I don't think its works with light tracer or vray in 3d max..
can you make it works with light tracer or vray too

SavhannaV's avatar
Can you use this with Maya 2015?
LoftyLight's avatar
I don't know anything about scripting for Maya or whether 3DS Max scripts are compatible with it or not. So I'm going to say probably not.
junkymana's avatar

I barely have knowledge about working in Max, but I have a friend that might find this useful.
Saved to favourites :)
KUNAIfever's avatar
does it work w/ dw models ?
LoftyLight's avatar
I don't know but it probably does. It just loops over the meshes and changes the properties of the material on each one.
XNAaraL's avatar
Very useful.
FazedNinja's avatar
Thank you, I was interested in creating. And this helped a ton! I promise to credit you in future posts on this. :)
O-Luna-O's avatar
Epic Job! Cant Wait for use it, hope ist easy because im so noob with renders!
dk10086's avatar
Interesting, It will save much time, Thank you
nexus-2's avatar
That's very cool, thanks a lot for sharing!
MONO-DURAN's avatar
Thanks for share!
SabishikuKage's avatar
Very useful Thank you :hug:
REMandel's avatar
Thanks!  This will prove most useful!
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In