View Full Version : How to greate a Multi/Sub-object
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!!
|
|
galagast
07-09-2005, 07:02 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!
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.
galagast
07-09-2005, 03:19 PM
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
CGTalk Moderation
07-09-2005, 03:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.