PDA

View Full Version : MaxScript - Modifying multiple multiple objects at once.


TapioKa
02-24-2004, 07:20 PM
Hello everyone,

I need some help on something (I think) is simple.

I have a whole bunch of AEC trees. I made a macroscript button which turns off the leaves, and turns on branches.

(
$.ShowLeaves = off
$.ShowBranches = on
)

but if I want to do that to a multiple of trees at the same time I can't. I think the reason being is that they all have different seed values.

Anyway I can get around this? (I have hundreds of trees in my scene)

Thanks!

cyril

TapioKa
02-24-2004, 07:36 PM
Nevermind, It works now.

I might have been because I had selected another unrelated object.

On a related note, does anyone know how I can change the seed value randomly with selected trees?

Thanks for reading!

cyril

Asgaard
02-24-2004, 08:53 PM
try:


for obj in selection do
(
try
(
(obj.seed = random 0 500)
)
catch()
)


You can change the max possible number generated by the Random function to a value which suits your needs ...
so long...

TapioKa
02-24-2004, 10:08 PM
Asgaard,

Than you very much! Works great. I was aware of the random function, but I couldn't get it to work with multiple selections.

Sweet!:thumbsup:

Thanks again!

cyril

CGTalk Moderation
01-17-2006, 01:00 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.