From 25b081e53a9128021f7af12ba9f31d57c546667c Mon Sep 17 00:00:00 2001 From: Pullusb Date: Wed, 13 Apr 2022 19:34:12 +0200 Subject: [PATCH] fix cycles-set and foot pin 0.9.1 --- OP_expand_cycle_step.py | 13 +++++++++++++ __init__.py | 4 ++-- fn.py | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/OP_expand_cycle_step.py b/OP_expand_cycle_step.py index 035c779..c56f86b 100644 --- a/OP_expand_cycle_step.py +++ b/OP_expand_cycle_step.py @@ -294,10 +294,23 @@ def pin_down_feets(): if not fcu.data_path.endswith('.location'): continue + all_extremes = [k for k in fcu.keyframe_points if k.type == 'EXTREME'] + if not all_extremes: + if debug: print(f'skip (no extremes marks): {fcu.data_path}') + continue + + if len(all_extremes) == len(fcu.keyframe_points): + if debug: print(f'skip (only extremes): {fcu.data_path}') + continue # skip same data path with different array index to avoid multiple iteration if fcu.data_path in viewed_data_paths: + if debug: print(f'skip (already evaluated): {fcu.data_path}') continue + + # TODO might need to filter the other array index (using a find) + # to do the action only on the one that has the best set of markers + # maybe check the wider values ? (meanning it's in direction of move) viewed_data_paths.append(fcu.data_path) diff --git a/__init__.py b/__init__.py index fe15de2..cd2cb4b 100644 --- a/__init__.py +++ b/__init__.py @@ -4,10 +4,10 @@ bl_info = { "name": "Unfold Anim Cycle", "description": "Anim tools to develop walk/run cycles along a curve", "author": "Samuel Bernou", - "version": (0, 9, 0), + "version": (0, 9, 1), "blender": (3, 0, 0), "location": "View3D", - "warning": "WIP", + "warning": "", "doc_url": "https://gitlab.com/autour-de-minuit/blender/unfold_anim_cycle", "category": "Object"} diff --git a/fn.py b/fn.py index c616e58..ea90b58 100644 --- a/fn.py +++ b/fn.py @@ -506,5 +506,6 @@ def create_cycle_modifiers(ob=None): continue if b_name not in name_list: continue - print(f'Adding cycle modifier {fc.data_path}') - _m = fc.modifiers.new(type='CYCLES') \ No newline at end of file + # print(f'Adding cycle modifier {fc.data_path}') + _m = fc.modifiers.new(type='CYCLES') + fc.update() \ No newline at end of file