update 2
the problem is very "easy"..bpy.ops.transform.transform(mode='TIME_TRANSLATE'
DON'T WORK ...anything happend if you use that.... any action, any return, any error, any...
update 1
please check this video... I want to do the same with python but I don't know why this don't work
https://youtu.be/_h9WRh51d4A 1
-----------------
I'm trying with:
bpy.ops.transform.transform(mode='TIME_TRANSLATE', value=(0.996151, 0, 0, 0), axis=(0, 0, 0), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
but nothing happend.
if I use print
that code return "finished"
but if I use that in console that return {'CANCELLED'}
here my full code:
import bpy
numero_frames = 5
original_type = bpy.context.area.type
bpy.context.area.type = "DOPESHEET_EDITOR"
bpy.ops.action.select_leftright(
mode='RIGHT',
extend=False)
bpy.ops.transform.transform(mode='TIME_TRANSLATE', value=(20, 0, 0, 0), axis=(0, 0, 0), proportional='DISABLED', proportional_size=1, mirror=False, constraint_axis=(False, False, False), constraint_orientation='GLOBAL')
bpy.context.area.type = original_type
do you know what I'm doing wrong? I should be use another code?
bpy.context.active_object.animation_data.action.fcurves[0].keyframe_points[0].co[0] += 20
$\endgroup$