Home Coding, Scripting, Shaders

[maxscript] How to create a range of numbers to be used in material selections

Kyle_butler
polycounter lvl 11
Offline / Send Message
Kyle_butler polycounter lvl 11
Hi! I'm a noobie in scripting, but I'm trying to automatize some repetitive tasks at my job.

I want to turn on this function in my multi material selection.

For instance: to change the RGB colors of my materials, instead of typing all the way from 1 to 100, how can I make it more straight to the point:

meditMaterials[1].ambient = color 230 230 230
meditMaterials[1].Diffuse = color 230 230 230

meditMaterials[2].ambient = color 230 230 230
meditMaterials[2].Diffuse = color 230 230 230

meditMaterials[3].ambient = color 230 230 230
meditMaterials[3].Diffuse = color 230 230 230

meditMaterials[4].ambient = color 230 230 230
meditMaterials[4].Diffuse = color 230 230 230

...

meditMaterials[100].ambient = color 230 230 230
meditMaterials[100].Diffuse = color 230 230 230

Is there any way to make something like so

meditMaterials[from 1 to 100].ambient = color 230 230 230
meditMaterials[from 1 to 100].Diffuse = color 230 230 230



I face the same thing when I try to turn on a function inside my node
sceneMaterials["Material #01"].materialList[1].alt_mat_night.tex_diffuse_on = on
sceneMaterials["Material #01"].materialList[2].alt_mat_night.tex_diffuse_on = on

And so on...

Replies

Sign In or Register to comment.