PDA

View Full Version : How can I refer object itself in Maxscript?


char_animator
04-30-2006, 08:23 AM
Hi

I want to use script controller to control a vaule of an objecy with another value of same object.

For example, I want to use script controller for diffuse color of a material.

When I assign the material to 10 objects, I want to the script controller take the handle value of the object and use it as a seed number for randome function.

So every object has a different color within a range that I set.

Thanks.

hblan
04-30-2006, 01:47 PM
maybe useful :

1. save the material value into a variable ,eg: theSaveMat=$box01.material
2. write a function to get random material from thesaveMat ,and then give back the value to theSaveMat.

if ur function like this ,for eg:


fn randomMatCreator theMat =
(
seed i
theMat.<something> =random <somting>
......
return theMat
)

then u can loop it and get random material from previous variable :

for i=1 to 100 do
(
theSaveMat=randomMatCreator theSaveMat
current_object.material=theSaveMat
..............
)

CGTalk Moderation
04-30-2006, 01:47 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.