Hi guys,
Any help would be greatly appreciated. Currently I have to do a really repetitive process at work for hundreds of models and I was wondering if any of you guys had a max script to reduce the process time.
My process involves:
Increasing the self illumination to 100% then pressing the' display texture in viewport' button for every individual material within a multi/sub object material.
If anyone can help please post!
Thanks

Replies
Then go to View menu very top, to the left,and choose Activate all maps to display all maps in one go.
Now it doesn't turn on self illum to 100%, it's just a viewport "style" si if you need to export your model at 100% self illum for some obscure reasons, you're out of luck for this one.
Scriptspot.com might help in that case.
I'm baking over 500 models which have been generated by another program. The models are simple boxes of different dimensions and ratios. Each model has a multisub material with 6 materials which need changing to 100% self illumination for baking. I also need to view the materials in the viewport so I can check they are mapped correctly. Once this is done the model is then baked.
I have to bake it manually because the automatic packing doesn't work very well.
I've managed to get a script working which displays all the textures in the viewport and I'm trying to adapt it so that it changes the illumination to 100%. Here is the script so far:
( on execute do ( for object in selection do if (classOf object.material == Standard) then ( object.material.showInViewport = on object.material.selfIllumAmount = 100 ) else if (classOf object.material == Multimaterial) then ( for b = 1 to b = object.material.numsubs do ( if (classOf object.material.materialList[b] == Standard) then ( object.material.showInViewport = on object.material.selfIllumAmount = 100 ) ) ) ) )The code breaks when trying to set the illumination to 100% in a multi/sub material but works for a standard material. If you take out the self illumination lines the display all in viewport works with both a standard and a multi/sub material.
MacroScript SelfIllumination category:"EdNWoodysScripts" tooltip:"Change Materials to Self Illuminated" ButtonText:"SelfIlluminated" ( on execute do ( for theNode in (Selection as Array) where ((superClassOf theNode) == GeometryClass) do ( local theMaterial = theNode.material if ((classOf theMaterial) == Standard) then ( theMaterial.selfIllumAmount = 100 if ((classOf theMaterial.diffuseMap) == BitmapTexture) then ( theMaterial.opacityMap = theMaterial.diffuseMap theMaterial.opacityMap.monoOutput = 1 ) showTextureMap theMaterial true ) else if ((classOf theMaterial) == MultiMaterial) then ( for theSubMat in theMaterial.materialList where ((classOf theSubMat) == Standard) do ( theSubMat.selfIllumAmount = 100 if ((classOf theSubMat.diffuseMap) == BitmapTexture) then ( theSubMat.opacityMap = theSubMat.diffuseMap theSubMat.opacityMap.monoOutput = 1 ) showTextureMap theSubMat true ) ) ) updateToolbarButtons() ) )Thank you so much for you help,
I have managed to achive what i wanted to achive with the help of your code.
So the final script is:
( on execute do ( for theNode in (Selection as Array) where ((superClassOf theNode) == GeometryClass) do ( local theMaterial = theNode.material if ((classOf theMaterial) == Standard) then ( theMaterial.selfIllumAmount = 100 showTextureMap theMaterial true ) else if ((classOf theMaterial) == MultiMaterial) then ( for theSubMat in theMaterial.materialList where ((classOf theSubMat) == Standard) do ( theSubMat.selfIllumAmount = 100 showTextureMap theSubMat true ) ) ) updateToolbarButtons() ) )This will increase the self illumination to 100% and 'display texture in viewport' for a multi/sub object matierial.
Thnak so much this will save me alot of time :thumbup: