# automate keyframes group to non-linear position

Can't find any information about very useful feature for animation and specially motion graphics, I will very appreciate any help (before i'm starting asking my friends to write a plugin...):

• Like bezier curves in the graph editor? – JakeD Aug 29 '16 at 22:28
• Hello, thanx for being interested in my question. no, bezier curves controls what happening in between of two keyframes - i want to control a group of keyframes. for example - to automate a bouncing ball animation. – LDCO Aug 29 '16 at 22:37

Here I've added a dummy action to give me 10 equally spaced keyframes, frames 1 to 10.

import bpy

obj = bpy.context.object
for x in range(10):
obj.keyframe_insert('location', frame=x+1)


Now running this script gives me the result you are after

import bpy
obj = bpy.context.object
action = obj.animation_data.action

x, y = action.frame_range
for fcurve in action.fcurves:
i = 1
L = (y - x)
# preserve the first and last kfps
print(fcurve.data_path, fcurve.array_index)
while i < len(fcurve.keyframe_points) - 1:
p = fcurve.keyframe_points[i-1].co.x
fcurve.keyframe_points[i].co.x = p + L / 2
print(i, p + L / 2)
L /= 2
i += 1


• Thnks very much! I thought I wont get an answer so I started sort of wring my own script, with some issues - link. Tell me please - can I use this script to make this kind of think link? – LDCO Sep 7 '16 at 22:31
• Yes can do most anything. In JS example link 0 gives us end result above, 50, starting point above, not sure where you've gone with 100. Maybe ask another q? There are some quick methods to set all keyframe coords at once from a flat list. – batFINGER Sep 8 '16 at 6:47

Use the interpolation mode found here in the graph editor:

You should also be able to do something like this with f-curve modifiers:

https://www.blender.org/manual/editors/graph_editor/fcurves/fmodifiers.html

• maybe i didn't explained well the issue... what your are proposing is concern only ONE keyframe, what i'am trying to do is to manipulate a group of existing keyframes. For example in blender there is no possibility to offset a keyframes of different objects, there is a plugin for this - github.com/mrachinskiy/commotion – LDCO Aug 30 '16 at 1:01