diff --git a/CHANGELOG.md b/CHANGELOG.md index b9af359..70878a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +1.4.3 + +- fixed: reset constrained bone position and add a location key at (0,0,0) + 1.4.2 - added: `Ctrl + click` on Add cycle modifier remove all cycle on all fcurves (hided option to force clean) diff --git a/OP_setup_curve_a_to_b.py b/OP_setup_curve_a_to_b.py index 6960fec..526d13f 100644 --- a/OP_setup_curve_a_to_b.py +++ b/OP_setup_curve_a_to_b.py @@ -61,8 +61,8 @@ class AW_OT_create_a_b_step(bpy.types.Operator): a = markers[0].location b = markers[1].location - a # remove a postion to get position in curve object space - a_frame = int(markers[0].name.split('_')[-1]) - b_frame = int(markers[1].name.split('_')[-1]) + a_frame = int(markers[0].name.split('_')[-1].split('.')[0]) + b_frame = int(markers[1].name.split('_')[-1].split('.')[0]) # Set the curve and constraint curve = fn.generate_curve(location=a, direction=b, name='curve_path', context=context) @@ -70,6 +70,10 @@ class AW_OT_create_a_b_step(bpy.types.Operator): settings.path_to_follow = curve fn.create_follow_path_constraint(ob, curve) + # reset location to remove offset + root.location = (0,0,0) + root.keyframe_insert('location', frame=a_frame) + # refresh evaluation so constraint shows up correctly bpy.context.scene.frame_set(bpy.context.scene.frame_current) @@ -77,8 +81,6 @@ class AW_OT_create_a_b_step(bpy.types.Operator): ## remove all markers or keep for later reuse ? remove_spacetime_keys(context=None) - - # if speed calculation is done later need to know start and end frame... # Set frame start and end settings.start_frame = a_frame diff --git a/OP_setup_curve_path.py b/OP_setup_curve_path.py index 2f23fb1..0a2bae3 100644 --- a/OP_setup_curve_path.py +++ b/OP_setup_curve_path.py @@ -38,7 +38,13 @@ class AW_OT_create_curve_path(bpy.types.Operator): settings.path_to_follow = curve fn.create_follow_path_constraint(ob, curve) - + + # reset location to remove offset + root.location = (0,0,0) + root.keyframe_insert('location') + #root.rotation_euler = (0,0,0) + # root.keyframe_insert('rotation_euler') + # refresh evaluation so constraint shows up correctly bpy.context.scene.frame_set(bpy.context.scene.frame_current) return {"FINISHED"} diff --git a/__init__.py b/__init__.py index 61822ae..c7e9f81 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ bl_info = { "name": "Auto Walk", "description": "Develop a walk/run cycles along a curve and pin feets", "author": "Samuel Bernou", - "version": (1, 4, 2), + "version": (1, 4, 3), "blender": (3, 0, 0), "location": "View3D", "warning": "",