fix wrong anim target

master
Pullusb 2022-04-11 19:56:38 +02:00
parent 57aae8af75
commit cf8fdc0f71
1 changed files with 16 additions and 13 deletions

View File

@ -200,6 +200,8 @@ class UAC_OT_bake_cycle_and_step(bpy.types.Operator):
if err[0] == 'ERROR':
return {"CANCELLED"}
## all followup is not needed when animating on one
if not context.scene.anim_cycle_settings.linear:
# CHAINED ACTION : step the path of the curve path
err = step_path()
@ -209,9 +211,10 @@ class UAC_OT_bake_cycle_and_step(bpy.types.Operator):
return {"CANCELLED"}
else:
# Delete points in curve action between first and last and go LINEAR
curve = context.scene.anim_cycle_settings.path_to_follow
if curve:
act = fn.get_obj_action(curve.data)
# curve = context.scene.anim_cycle_settings.path_to_follow
# if curve:
# act = fn.get_obj_action(curve.data)
act = fn.get_obj_action(context.object)
if act:
timef = next((fc for fc in act.fcurves if fc.data_path.endswith('.offset') and 'constraint' in fc.data_path), None)
if timef: