Is there any way to insert f-curves keyframes by script ?

I'm writing a python script for animation in Blender and I'm looking for a way to insert keyframes automatically.
So far I have: import bpy import mathutils as m import math import random
armature = bpy.data.objects['Amature']
curves = armature.animation_data.action.fcurves

def add_curve():

    action = bpy.data.actions.new(name = 'Test')
    curves = action.fcurves

    keyframes = [0,10,30] # defining keyframes for insertion
    for c in curves:

        for k in keyframes:
            c.keyframe_insert( data_path = ??)
            # Is there another method ?
Thanks !

Комментарии

Популярные сообщения из этого блога

Skipping acquire of configured file 'contrib/binary-i386/Packages' as repository … doesn't support architecture 'i386'

Connection string for MariaDB using ODBC

Celery like system based on django channels