This is the script I've got. It just basically offsets every selected objects animation for the other one as shown in this Tutorial
import bpy
obj = bpy.context.selected_objects
objlist = len(obj)
offset = range(objlist+1)
for i in range(objlist):
animData = obj[i].animation_data
action = animData.action
fcurves = action.fcurves
for curve in fcurves:
keyframePoints = curve.keyframe_points
for keyframe in keyframePoints:
keyframe.co[0] += offset[i]
keyframe.handle_left[0] += offset[i]
keyframe.handle_right[0] += offset[i]
It works alright but when I change it to:
import bpy
obj = bpy.context.selected_pose_bones
objlist = len(obj)
offset = range(objlist+1)
for i in range(objlist):
animData = obj[i].animation_data
action = animData.action
fcurves = action.fcurves
for curve in fcurves:
keyframePoints = curve.keyframe_points
for keyframe in keyframePoints:
keyframe.co[0] += offset[i]
keyframe.handle_left[0] += offset[i]
keyframe.handle_right[0] += offset[i]
I get this error
AttributeError:'PoseBone' object has no attribute 'animation_data'