Increasing value by amount of selected objects

Hi guys, i'm pritey new to max scripting and find myself stuck on this problem.

I have tried searching around but i'm not entirely sure what my search word for the issue should be.

What i'm trying to do:

I have 4 spline circles. and i want to add a shell modifier to each and one of them but i want the shell outer amount to increase, so you get a step effect. first spline circle value 1 second value 2 and so on.

 

All i manage to do before getting stuck is this:

 

 

for i in selection do

 

(

addmodifier i (shell outeramount: 2)

)

 

so as the noob i am i tought i could add (shell outeramount: i*2).....but i is no integer. its the selected object itself.

Is there then a way to tell max to look for the selected objects position in the collection and then use that number or annything really?

 

Thanks :)

-Minimus

 

 

 

 

 

 

 

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

try this one

for s = 1 to selection.count do
(
	addModifier selection[s] (Shell outeramount:s)
)

It's important to select splines in order
If you want different outheramount values then

vals = #(5,10,15,20) --values for four splines
for s = 1 to selection.count do
(
	addModifier selection[s] (Shell outeramount:vals[s])
)

barigazy

minimus's picture

Thanks!

That worked out great!!
I dint know it was possible to use the for loop like that.
genius Thanks allot.

-Minimus

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.