View Full Version : copying keyframe values to next/previous keyframe
12-04-2003, 09:29 AM
hi i was trying to write a tiny script to help when animating but i couldnt do it , if anyone can help me explain how can i use mel to take one node's values on a keyframe and copy it to the next or previous keyframe ?
i know i can do it buy middle mouse drag the key on time slider and set key :)
thanks in advance
12-05-2003, 07:33 AM
Most of this can be done directly with the "keyframe" command. Have you looked at this command and tried it?
12-05-2003, 08:29 AM
The commands you seek are:
followed by a well placed
12-06-2003, 09:28 AM
sorry guys but ive been trying to do it but i couldnt figure out :-/
whats the flag that i need to use with pasteKey to make it paste to the nextKeyframe ?
12-06-2003, 09:35 AM
Not sure really... but you can try using one of
to/timeOffset time How much to offset the pasted keys in time (for time-input animation curves).
-fo/floatOffset float How much to offset the pasted keys in time (for non-time-input animation curves).
-vo/valueOffset float How much to offset the pasted keys in value.
or explicitly set the key with the -time flag
have a read of the MEL reference...
12-06-2003, 09:37 AM
yes ive read it , but i really dont know almost anything about mel , im trying to learn it . i couldnt get it to paste to the nextkey of the attribute .
12-06-2003, 10:05 AM
This is how I would do it.
I assume you want to copy a key from time T to time T+1... am I right?
ok, so for the frame at time 50, copy it..
copyKey -time 50 -option keys nurbsCylinder1.translate;
the paste it...
pasteKey -time 51 -option insert nurbsCylinder1.translate;
Hope that helped...
12-06-2003, 10:09 AM
ah sorry this wasnt what i meant.
what i want to do is lets say i have 2 keyframes , just on translate Z
at frame 0 , translate Z = 5
at frame 20 , translate z = 60
so i want to grab any frame before frame 20 , and paste it to frame 20 which is my next key on the timeline .
like when you middle mouse drag a frame on the timeline over a keyframe or another frame and set key . it pastes the values from the frame that you middle mouse dragged .
*but i dont want to type frame 20 because i dont want to look at whats frame number of the next keyframe each time .
12-10-2003, 09:30 AM
Sorry, been a while, but will this do what you want?
Select a time on the timeline where the key you wish to copy is, and then run the script. It will copy that key to the next keyframe in the timeline, for ALL animcurves of the currently selected object(s).
run the script with
let me know if that's what you were after
12-10-2003, 09:36 AM
ah i really appreciate it , works great!
01-16-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.