ScriptSpot

Forum topic · General Scripting

delete and create key

By Frika · 2007-07-24

Description

Hello all,

I´m just a beginner of script writing...
I wrote my own little script for my car wheels. In some cases I want to set a rotation key and sometimes I want to delete a key. I cant figure out the right syntax. I think it´s something like this:

"at time 5 deleteKey $wheel.rotation.y" or
"at time 25 addNewKey $wheel.rotation.z"

I know that this is wrong but you may understand what I want to do.
Thank you and regards
Frika

Comments (4)

is this you ask for -- b =

Anubis · 2009-12-14

is this you ask for --

b = box()
for i=1 to 100 do at time i animate on b.height=random 1 100
delete b.height.controller.keys[1]

crazyosachou · 2007-10-14

hi guys,

Well, Aline 3D is right, but there's other simple way:

----adding keys

addnewkey $.pos.controller.X_position.controller 10f

--u can also add different type of keys, just
--set the type of properties like for expample

$.height.controller= bezier_float()
addnewkey $.hegiht.controller 10f --it add a key to height

-------------------------
--deleting keys ,just use "delete" function

delete $.pos.controller.X_posistion.controller.key[]

--if u want to delete the 2nd height key

delete $.height.controller.keys[2]

--------------------------------------

hope it'll help u.
Good luck.

siran · 2009-12-13

Hi, please help me to delete keys,

delete $.height.controller.keys[2]

only this works, but I want to delete first time

b=box()
for i=1 to 100 do
at time i animate on b.height=random 1 100
delete $.height.controller.keys [ 20]

in this script.

Aline3D · 2007-08-23

Hi,

 Try this:

--DELETE KEY:

indexKey = getKeyIndex $wheel.pos.controller.X_Position.controller 5f

deleteKey $wheel.pos.controller.X_Position.controller indexKey


--SET KEY

animate on

(

    at time 5 $wheel.pos.controller.X_Position = $wheel.pos.controller.X_Position

)