PDA

View Full Version : Setting All Scene Material Maps Amounts


projectironwill
02-12-2005, 06:16 AM
I'm new to both 3ds max 7 & MAXScript and I'm having trouble with creating a script to set all of the Material Map Amounts on all materials in a scene back to the default Map Amount values.


-- I want to step through each Material in the scene using a loop.

-- Change the Maps Amount for each material to the following:
meditMaterials[1].ambientMapAmount = 100
meditMaterials[1].diffuseMapAmount = 100
meditMaterials[1].specularMapAmount = 100
meditMaterials[1].specularLevelMapAmount = 100
meditMaterials[1].glossinessMapAmount = 100
meditMaterials[1].selfillumMapAmount = 100
meditMaterials[1].opacityMapAmount = 100
meditMaterials[1].filterMapAmount = 100
meditMaterials[1].bumpMapAmount = 30
meditMaterials[1].reflectionMapAmount = 100
meditMaterials[1].refractionMapAmount = 100
meditMaterials[1].displacementMapAmount = 100

-- Save the file
max file save


-- Open File Command to get the next file.
max file open

-- END OF SCRIPT


What is confusing me is the meditMaterials[#] IDs. I need to change all of the materials in the scene, not just using one ID.

This can be for Max 7 or 8.

Thanks for any help that can be provided.

limion
24-12-2005, 07:57 PM
i'm not a max scriptor but i do know some c and java, so i hope i can help. i think you might want to look for a way to creat a standard loop in maxscrip( like repeat ... until..., do ... (while)... loop, for...next) then you just have to declare a variable and use that as the id.
an example (how it would be done in java):

for(int i=0;i++;i>10){
meditMaterials[i].ambientMapAmount = 100
}

hope this helps a bit.