Notifications
Clear all
[Closed] How to greate a Multi/Sub-object
Jul 09, 2005 3:03 am
How to greate a Multi/Sub-object in 24 slot and this Multi/Sub-object have 1-3 id
their color is random
Thank you!!
3 Replies
Jul 09, 2005 3:03 am
this might work…
for i in 1 to 24 do -- loop through 1 to 24
(
the_mat = multimaterial numsubs:3 -- create a variable that will hold the new multimaterial with 3 submaterials
meditmaterials[i] = the_mat -- set it to a slot in the material editor
for i in 1 to 3 do -- loop through 1 to 3 (submaterials)
(
the_mat.materialList[i].diffuse = random black white -- set each submaterials diffuse to a random color
)
)
hope this helps!
Jul 09, 2005 3:03 am
Thank you galagast very much.
but this Multi/Sub-object is twenty-fouth slot
it isn’t loop.
I hope you can help me to write it.
Jul 09, 2005 3:03 am
oh! sori my mistake, i thought you were after all the material slots…
you only need slot 24?
the_mat = multimaterial numsubs:3 -- create a variable that will hold the new multimaterial with 3 submaterials
meditmaterials[24] = the_mat -- set it to a slot in the material editor
for i in 1 to 3 do -- loop through 1 to 3 (submaterials)
(
the_mat.materialList[i].diffuse = random black white -- set each submaterials diffuse to a random color
)
i just replaced the highlighted text from:
meditmaterials[i]
to
meditmaterials[24]
hope this helps