ScriptSpot

Forum topic · General Scripting

Beginners question

By hanselmoniz · 2012-01-17

Description

--animation a slice plane of a slice modifier in time on selected objects
for i = 1 to selection.count do
(local sliceMod = sliceModifier Slice_Type:2
local capMod = Cap_holes ()
addModifier selection[i] sliceMod
addModifier selection[i] capMod
with animate on
( if selection[i].name=="b0" + 1 as string
do (
at time (1+ (i*2)) sliceMod.Slice_Plane.pos = [0,0,0]
at time ((i*5) + 2) sliceMod.Slice_Plane.pos = [0,0,25])
)
)

--- im not able to step the selection as per name

Comments (1)

Ofer Zelichover · 2012-01-19

Hi,

I'm not exactly sure what you're trying to do, but one thing looks like it might be a type in your code. Is is supposed to be '1 as string' in this line:
if selection[i].name=="b0" + 1 as string
This would mean that you test the object's name, and only the objects with the name b01 will be animated.

Cheers,
o