ScriptSpot

Forum topic · General Scripting

Help animate on

By kimarotta · 2012-05-30

Description

I have a problem with animate on, I have an array of 920 numbers and would like to put in the position of an object. but when run the code below it creates a keyframe always the last number of array ... someone could help?


pos_tst = #(221.364,221.939,222.395,222.381,222.225,222.072,222.052,225.235)
pos_tst.count
for t = 1 to pos_tst.count do
(
animate on for p in pos_tst do
at time t
(
$.pos = [p,0,0]
)
)


for p in pos_tst do 
(
print p
)
Comments (7)

kimarotta · 2012-05-30

I'm sorry to confuse ...very thanks

barigazy · 2012-05-30

If you think about offset (key step by 5), i use this to see result better. Offset by 1 will produce faster animation. But you know that already :)
Cheers!

little example

barigazy · 2012-05-30


pos_tst = #(100,50,200,150,300,250,400,350,500,450)
objX = Box wirecolor:red
objY = Box wirecolor:green
objZ = Box wirecolor:blue
offset = 5
animate on
(
for t in 1 to pos_tst.count do
(
at time (t*offset)
(
objX.pos = [pos_tst[t],0,0]
objY.pos = [0,pos_tst[t],0]
objZ.pos = [0,0,pos_tst[t]]
)
)
)

kimarotta · 2012-05-30

Perfect, very thanks Barigazy...

barigazy · 2012-05-30

i change exampe, sorry

kimarotta · 2012-05-30

Yeah I saw ... Only a doubt ... Why the animate on need for a multiplication and not accept the direct number?

barigazy · 2012-05-30

Not undertand your question. What multiplication?