delete and create key

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

Comment viewing options

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

is this you ask for -- b =

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]

my recent MAXScripts RSS (archive here)

crazyosachou's picture

hi guys, Well, Aline 3D is

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.

learn more,learn as fast as u can, coz u can be not able to learn more tommorow!!

siran's picture

Hi, please help me to delete

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's picture

Hi,  Try this: --DELETE

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
)

AlineLima
Script Developer - SeagullsFly
www.seagullsfly.com
Brasil

Comment viewing options

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