0
$\begingroup$

I can move keyframe for transform action but how to do it for other animation keyframes like curve bevel start or end ??

here's my code:

for o in bpy.context.selected_objects :
    action = o.animation_data.action    
    for i in action.fcurves:
        for keyframe in i.keyframe_points:
            keyframe.co[0]=keyframe.co[0]+10
        i.update()
$\endgroup$
0
$\begingroup$

Try fcurves.find...you need to access it from object.data.animation_data instead of object.animation_data (since bevel start end are part of data block). You can find the data path by right clicking on the property in the edit properties panel.

for o in bpy.context.selected_objects :
    action = o.data.animation_data.action # Note: o.data.animation_data
    fcurve = action.fcurves.find('bevel_factor_start'):
    for keyframe in fcurve.keyframe_points:
        keyframe.co[0]=keyframe.co[0]+10

```
$\endgroup$
2
  • $\begingroup$ Thanks Drawer! What if I want both to be updated? I mean o.data.animation AND o.animation.data if exist... I can't figure out how to filter each case $\endgroup$ – Loranozor Graphitz Oct 26 '20 at 17:40
  • $\begingroup$ There are some properties belonging to object and some to object.data. Transform and location are of object and bevel start etc. are in object.data. Not clear what exactly you want to do. $\endgroup$ – blunder Oct 28 '20 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.