Maxscript - Batch a bunch of materials



I’m on the brink of a very repetitive, dull task. Hope somene could help me

I create more than 200 materials (I have them inside a .mat on project manager plugin), they are all based on the same simple shader, though and only differ in a Diffuse map and Displacement map (It’s a corona material).

The problem comes when I need to apply this material on a single object (the object is always the same, only change the texture), save the object (max and fbx) and save all the textures also on a single folder. Jpg’s, max and fbx.

I can’t say how hard it would be to create a script that automates this task, but I’d like to get some input here or I can pay for it (write me DM). I guess the script would have to do the following:

  1. (This step is already done but I would want to automate this also, now I have done it manually
  • Create material (duplicate from a pre-defined material) and name it after the object.
  • Assign bitmap texture map to the diffuse slot, and displacement map also. Both bitmaps have the same name: texture%Displacement, texture
  • Save .mat material (for example: Material-set01.mat)
  1. Open a pre-defined object (Its a scene with only this object), apply the material we create on the previous step

  2. Replace Coronadisplacement map modifier applied on the object to the new one.

  3. Rename textures based on some parametre I could change. (for example: Material-set01-00/01/02.jpg

  4. Create a folder name based on the same parametre of the previous step (for example: Material-set01)

  5. Save textures inside this folder

  6. Save a max 2016 and fbx (pre-defined preset), inside this folder (Material-set01-2016.max.)

  7. Go to the next textures and repeat the procees.

Unfortunately, my maxscript skills are non-existent…

If there is anyone out there, willing to write that script or write me a DM, I’d be able to reward him/her with a fee.