Welcome, Please Register or Login

Search Tags

  1. Lofty's Tools - XNALara to 3DS Max Material Tools
    Sections: Downloads \ 3D Studios Max \ Scripts
    Tags: Lofty's Tools Xnalara To 3Ds Max Material Tools




    ---------------------------
    --- 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]


    --- DESCRIPTION ---

    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.


    --- FEATURES---

    - 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.


    --- TECHNICAL INFO ---

    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.


    --- CHANGELOG ---

    v2.00:

    - 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.

    NOTE FROM STERLING - Things like enable 2 sided, save a lot of time :D & Merge meshes with same materials is great for lowering the number of .scx files :D

Tags

Several comma-separated tags will be considered as logical AND between them. You can also use semicolon for logical OR. AND has a priority over OR and you cannot use parentheses for logical grouping. Asterisk (*) within a tag will be regarded as a mask for "any string".