reset location at curve creation

1.4.3

- fixed: reset constrained bone position and add a location key at (0,0,0)
master
Pullusb 2022-04-27 10:57:48 +02:00
parent dbdba01485
commit 07118dafc8
4 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
1.4.3
- fixed: reset constrained bone position and add a location key at (0,0,0)
1.4.2 1.4.2
- added: `Ctrl + click` on Add cycle modifier remove all cycle on all fcurves (hided option to force clean) - added: `Ctrl + click` on Add cycle modifier remove all cycle on all fcurves (hided option to force clean)

View File

@ -61,8 +61,8 @@ class AW_OT_create_a_b_step(bpy.types.Operator):
a = markers[0].location a = markers[0].location
b = markers[1].location - a # remove a postion to get position in curve object space b = markers[1].location - a # remove a postion to get position in curve object space
a_frame = int(markers[0].name.split('_')[-1]) a_frame = int(markers[0].name.split('_')[-1].split('.')[0])
b_frame = int(markers[1].name.split('_')[-1]) b_frame = int(markers[1].name.split('_')[-1].split('.')[0])
# Set the curve and constraint # Set the curve and constraint
curve = fn.generate_curve(location=a, direction=b, name='curve_path', context=context) 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 settings.path_to_follow = curve
fn.create_follow_path_constraint(ob, 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 # refresh evaluation so constraint shows up correctly
bpy.context.scene.frame_set(bpy.context.scene.frame_current) bpy.context.scene.frame_set(bpy.context.scene.frame_current)
@ -78,8 +82,6 @@ class AW_OT_create_a_b_step(bpy.types.Operator):
## remove all markers or keep for later reuse ? ## remove all markers or keep for later reuse ?
remove_spacetime_keys(context=None) remove_spacetime_keys(context=None)
# if speed calculation is done later need to know start and end frame...
# Set frame start and end # Set frame start and end
settings.start_frame = a_frame settings.start_frame = a_frame
settings.end_frame = b_frame settings.end_frame = b_frame

View File

@ -39,6 +39,12 @@ class AW_OT_create_curve_path(bpy.types.Operator):
fn.create_follow_path_constraint(ob, 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 # refresh evaluation so constraint shows up correctly
bpy.context.scene.frame_set(bpy.context.scene.frame_current) bpy.context.scene.frame_set(bpy.context.scene.frame_current)
return {"FINISHED"} return {"FINISHED"}

View File

@ -4,7 +4,7 @@ bl_info = {
"name": "Auto Walk", "name": "Auto Walk",
"description": "Develop a walk/run cycles along a curve and pin feets", "description": "Develop a walk/run cycles along a curve and pin feets",
"author": "Samuel Bernou", "author": "Samuel Bernou",
"version": (1, 4, 2), "version": (1, 4, 3),
"blender": (3, 0, 0), "blender": (3, 0, 0),
"location": "View3D", "location": "View3D",
"warning": "", "warning": "",