From b05b0e2b6cd8bedf032d47dbb997523bc9c99efc Mon Sep 17 00:00:00 2001 From: Pullusb Date: Thu, 7 Apr 2022 14:46:00 +0200 Subject: [PATCH] delete old distance evaluation code --- OP_animate_path.py | 51 +--------------------------------------------- __init__.py | 2 +- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/OP_animate_path.py b/OP_animate_path.py index 553fdcf..98c0f56 100644 --- a/OP_animate_path.py +++ b/OP_animate_path.py @@ -73,7 +73,7 @@ def anim_path_from_translate(): # CHANGE - retiré le int de la frame # keyframes = [int(k.co[0]) for fcu in act.fcurves for k in fcu.keyframe_points] - ## calculate offset from bones by evaluating distance at extreme distance + ## calculate offset from bones by evaluating distance at extremes # fcurve parsing: @@ -184,55 +184,6 @@ def anim_path_from_translate(): print('end of set_follow_path_anim') - - """ ### old method using directly one axis - axis = {'X':0, 'Y':1, 'Z':2} - ## calculate offset from bones - loc_fcu = None - for fcu in act.fcurves: - if fcu.data_path.split('"')[1] != b.bone.name: - continue - if fcu.data_path.split('.')[-1] == 'location' and fcu.array_index == axis['Y']: - loc_fcu = fcu - if not loc_fcu: - return ('ERROR', 'Current bone, location.y animation not found') - - start = None - end = None - - ## based on extreme - for k in loc_fcu.keyframe_points: - # if k.select_control_point: # based on selection - if k.type == 'EXTREME': # using extreme keys. - if start is None: - start = k - end = k - else: - if start is not None: - ## means back to other frame type after passed breakdown we stop - break - - if start and end: - print(f'Offset from key range. start: {start.co.x} - end: {end.co.x}') - - if not start: - return ('ERROR', f"No extreme marked frame was found on bone {b.bone.name}.{['x','y','z'][loc_fcu.array_index]}") - if start == end: - return ('ERROR', f'Only one key detected as extreme (at frame {start.co.x}) !\nNeed at least two chained marked keys') - - start_frame = start.co.x - start_val = start.co.y - - end_frame = end.co.x - end_val = end.co.y - - move_frame = end_frame - start_frame - - # Y positive value (forward) -> - move_val = abs(start_val - end_val) - """ - - class UAC_OT_animate_path(bpy.types.Operator): bl_idname = "anim.animate_path" bl_label = "Animate Path" diff --git a/__init__.py b/__init__.py index 7df5f76..9e36b73 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "Unfold Anim Cycle", "description": "Anim tools to develop walk/run cycles along a curve", "author": "Samuel Bernou", - "version": (0, 4, 2), + "version": (0, 4, 3), "blender": (3, 0, 0), "location": "View3D", "warning": "WIP",