i'm trying to set some keyframe values programatically after its creation, and for now, i didn't find a way to return this keyframe properly, i have to loop through the entire fcurve which is not very efficient...
For example, i would like something like that :
# add a location x keyframe on frame 1
new_key = object.keyframe_insert(
"location",
index = 0,
frame = 1,
)
set keyframe left handle type
new_key.handle_left_type = "VECTOR"
set keyframe value
new_key.co[1] = "10"
But the keyframe_insert() method only return a Bool for succeeding or not in keyframe creation.
Do you guys know a way to get the keyframe the proper way ? Really stuck here !
Thanks in advance, cheers !
But the keyframe_insert() method only return a Bool for succeeding or not in keyframe creation.
Do you guys know a way to get the keyframe the proper way ? Really stuck here !
Thanks in advance, cheers !
ob.keyframe_insertcreates action, fcurve etc if need be, whereas you wish to get a reference to the fcurves keyframe_point. Also related https://blender.stackexchange.com/questions/55858/how-to-set-the-easing-of-keyframe-with-python-fast-slow-etc – batFINGER Mar 04 '21 at 12:03