full rename to autowalk
1.3.0 - changed: rename addon: `unfold anim cycle` >> `auto walk`master
parent
a7a3c5a96a
commit
b982c1a6f0
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
1.3.0
|
||||
|
||||
- changed: rename addon: `unfold anim cycle` >> `auto walk`
|
||||
|
||||
1.2.0
|
||||
|
||||
- changed: curve offset on base 100 (allow multiple action with same curve path animation range)
|
||||
|
|
|
@ -364,8 +364,8 @@ def anim_path_from_translate():
|
|||
|
||||
if debug: print('end of set_follow_path_anim')
|
||||
|
||||
class UAC_OT_animate_path(bpy.types.Operator):
|
||||
bl_idname = "anim.animate_path"
|
||||
class AW_OT_animate_path(bpy.types.Operator):
|
||||
bl_idname = "autowalk.animate_path"
|
||||
bl_label = "Animate Path"
|
||||
bl_description = "Use most representative 'in contact' feet of the cycle\
|
||||
\nSelect foot bone to use as reference\
|
||||
|
@ -395,8 +395,8 @@ class UAC_OT_animate_path(bpy.types.Operator):
|
|||
return {"FINISHED"}
|
||||
|
||||
|
||||
class UAC_OT_adjust_animation_length(bpy.types.Operator):
|
||||
bl_idname = "anim.adjust_animation_length"
|
||||
class AW_OT_adjust_animation_length(bpy.types.Operator):
|
||||
bl_idname = "autowalk.adjust_animation_length"
|
||||
bl_label = "Adjust Anim speed"
|
||||
bl_description = "Adjust speed\nOnce pressed, move up/down to move animation path last key value"
|
||||
bl_options = {"REGISTER"} # , "UNDO"
|
||||
|
@ -488,8 +488,8 @@ class UAC_OT_adjust_animation_length(bpy.types.Operator):
|
|||
# layout.prop(self, "val")
|
||||
|
||||
classes=(
|
||||
UAC_OT_animate_path,
|
||||
UAC_OT_adjust_animation_length,
|
||||
AW_OT_animate_path,
|
||||
AW_OT_adjust_animation_length,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -127,7 +127,6 @@ def bake_cycle(on_selection=True):
|
|||
# C.scene.frame_current = org_frame
|
||||
# detect last key in contact
|
||||
|
||||
# FIXME: need to use action offset fc instead of eval_time
|
||||
def step_path():
|
||||
'''Step the path anim of the curve to constant'''
|
||||
print(fn.helper())
|
||||
|
@ -183,8 +182,8 @@ def step_path():
|
|||
fn.update_action(act)
|
||||
print('end of step_anim')
|
||||
|
||||
class UAC_OT_bake_cycle_and_step(bpy.types.Operator):
|
||||
bl_idname = "anim.bake_cycle_and_step"
|
||||
class AW_OT_bake_cycle_and_step(bpy.types.Operator):
|
||||
bl_idname = "autowalk.bake_cycle_and_step"
|
||||
bl_label = "Bake key and step path "
|
||||
bl_description = "Bake the key and step the animation path according to those key\
|
||||
\n(duplicate to a new 'baked' action)"
|
||||
|
@ -407,8 +406,8 @@ def pin_down_feets():
|
|||
bpy.data.collections.remove(tmp_col)
|
||||
|
||||
|
||||
class UAC_OT_pin_feets(bpy.types.Operator):
|
||||
bl_idname = "anim.pin_feets"
|
||||
class AW_OT_pin_feets(bpy.types.Operator):
|
||||
bl_idname = "autowalk.pin_feets"
|
||||
bl_label = "Pin Feets"
|
||||
bl_description = "Pin feets on keys marked as extreme\n(duplicate to a new 'pinned' action)"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -430,8 +429,8 @@ class UAC_OT_pin_feets(bpy.types.Operator):
|
|||
|
||||
# --- Quick action management
|
||||
|
||||
class UAC_OT_set_action(bpy.types.Operator):
|
||||
bl_idname = "uac.set_action"
|
||||
class AW_OT_set_action(bpy.types.Operator):
|
||||
bl_idname = "autowalk.set_action"
|
||||
bl_label = "Set action by name"
|
||||
bl_description = "Set action on active object using passed name"
|
||||
bl_options = {"REGISTER", "INTERNAL"}
|
||||
|
@ -447,8 +446,8 @@ class UAC_OT_set_action(bpy.types.Operator):
|
|||
context.object.animation_data.action = act
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_step_back_actions(bpy.types.Operator):
|
||||
bl_idname = "uac.step_back_actions"
|
||||
class AW_OT_step_back_actions(bpy.types.Operator):
|
||||
bl_idname = "autowalk.step_back_actions"
|
||||
bl_label = "Actions Step Back"
|
||||
bl_description = "Step back to a previous action if 'baked' or 'pinned' action are not ok"
|
||||
bl_options = {"REGISTER", "INTERNAL", "UNDO"}
|
||||
|
@ -489,17 +488,17 @@ class UAC_OT_step_back_actions(bpy.types.Operator):
|
|||
if a == context.object.animation_data.action:
|
||||
layout.label(text=f'(current) >> {a.name}', icon='ACTION')
|
||||
continue
|
||||
layout.operator('UAC_OT_set_action', text=a.name, icon='ACTION').act_name = a.name
|
||||
layout.operator('AW_OT_set_action', text=a.name, icon='ACTION').act_name = a.name
|
||||
|
||||
def execute(self, context):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
classes=(
|
||||
UAC_OT_bake_cycle_and_step,
|
||||
UAC_OT_pin_feets,
|
||||
UAC_OT_set_action,
|
||||
UAC_OT_step_back_actions,
|
||||
AW_OT_bake_cycle_and_step,
|
||||
AW_OT_pin_feets,
|
||||
AW_OT_set_action,
|
||||
AW_OT_step_back_actions,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -22,8 +22,8 @@ def get_active_nla_strip(all_nla=False):
|
|||
print(f'{strip.name} on Track {nla.name}')
|
||||
return strip
|
||||
|
||||
class UAC_OT_nla_key_speed(bpy.types.Operator):
|
||||
bl_idname = "anim.nla_key_speed"
|
||||
class AW_OT_nla_key_speed(bpy.types.Operator):
|
||||
bl_idname = "autowalk.nla_key_speed"
|
||||
bl_label = "NLA Key Speed"
|
||||
bl_description = "Activate animate strip time and Keyframe linear for first and last animation frame"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -62,7 +62,7 @@ class UAC_OT_nla_key_speed(bpy.types.Operator):
|
|||
return {"FINISHED"}
|
||||
|
||||
classes=(
|
||||
UAC_OT_nla_key_speed,
|
||||
AW_OT_nla_key_speed,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
14
OP_setup.py
14
OP_setup.py
|
@ -11,8 +11,8 @@ from . import fn
|
|||
|
||||
## https://www.meccanismocomplesso.org/en/3d-rotations-and-euler-angles-in-python/
|
||||
|
||||
class UAC_OT_autoset_axis(bpy.types.Operator):
|
||||
bl_idname = "uac.autoset_axis"
|
||||
class AW_OT_autoset_axis(bpy.types.Operator):
|
||||
bl_idname = "autowalk.autoset_axis"
|
||||
bl_label = "Auto Set Axis"
|
||||
bl_description = "Define forward axis from armature"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -36,8 +36,6 @@ class UAC_OT_autoset_axis(bpy.types.Operator):
|
|||
|
||||
root_pos = ob.matrix_world @ root.matrix.to_translation()
|
||||
|
||||
up = Vector((0,0,1))
|
||||
|
||||
# gather all .R suffixed bones
|
||||
|
||||
all_right_pos = [ob.matrix_world @ b.matrix.to_translation() for b in ob.pose.bones if b.bone.name.lower().endswith('.r')]
|
||||
|
@ -74,8 +72,8 @@ class UAC_OT_autoset_axis(bpy.types.Operator):
|
|||
context.scene.anim_cycle_settings.forward_axis = best_axis
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_create_cycles_modifiers(bpy.types.Operator):
|
||||
bl_idname = "uac.create_cycles_modifiers"
|
||||
class AW_OT_create_cycles_modifiers(bpy.types.Operator):
|
||||
bl_idname = "autowalk.create_cycles_modifiers"
|
||||
bl_label = "Add Cycles Modifiers"
|
||||
bl_description = "Add cycles modifier on all bones not starting with [mch, org, def]\
|
||||
\nand that are non-deforming"
|
||||
|
@ -91,8 +89,8 @@ class UAC_OT_create_cycles_modifiers(bpy.types.Operator):
|
|||
|
||||
|
||||
classes=(
|
||||
UAC_OT_autoset_axis,
|
||||
UAC_OT_create_cycles_modifiers,
|
||||
AW_OT_autoset_axis,
|
||||
AW_OT_create_cycles_modifiers,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -18,8 +18,8 @@ def remove_spacetime_keys(context=None):
|
|||
bpy.data.objects.remove(o)
|
||||
bpy.data.collections.remove(walk_col)
|
||||
|
||||
class UAC_OT_create_a_b_step(bpy.types.Operator):
|
||||
bl_idname = "anim.create_a_b_step"
|
||||
class AW_OT_create_a_b_step(bpy.types.Operator):
|
||||
bl_idname = "autowalk.create_a_b_step"
|
||||
bl_label = "Create Two Points Curve"
|
||||
bl_description = "Create a straight curve between two defined position and time"
|
||||
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
|
||||
|
@ -77,8 +77,8 @@ class UAC_OT_create_a_b_step(bpy.types.Operator):
|
|||
# if speed calculation is done later need to know start and end frame...
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_remove_a_b_step(bpy.types.Operator):
|
||||
bl_idname = "anim.remove_a_b_step"
|
||||
class AW_OT_remove_a_b_step(bpy.types.Operator):
|
||||
bl_idname = "autowalk.remove_a_b_step"
|
||||
bl_label = "Remove First Position"
|
||||
bl_description = "remove first point defining step"
|
||||
bl_options = {"REGISTER", "UNDO", "INTERNAL"}
|
||||
|
@ -95,8 +95,8 @@ class UAC_OT_remove_a_b_step(bpy.types.Operator):
|
|||
|
||||
|
||||
classes=(
|
||||
UAC_OT_create_a_b_step,
|
||||
UAC_OT_remove_a_b_step,
|
||||
AW_OT_create_a_b_step,
|
||||
AW_OT_remove_a_b_step,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -3,8 +3,8 @@ from . import fn
|
|||
|
||||
## step 1 : Create the curve and/or follow path constraint, snap to ground
|
||||
|
||||
class UAC_OT_create_curve_path(bpy.types.Operator):
|
||||
bl_idname = "anim.create_curve_path"
|
||||
class AW_OT_create_curve_path(bpy.types.Operator):
|
||||
bl_idname = "autowalk.create_curve_path"
|
||||
bl_label = "Create Curve"
|
||||
bl_description = "Create curve and add follow path constraint"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -43,8 +43,8 @@ class UAC_OT_create_curve_path(bpy.types.Operator):
|
|||
bpy.context.scene.frame_set(bpy.context.scene.frame_current)
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_create_follow_path(bpy.types.Operator):
|
||||
bl_idname = "anim.create_follow_path"
|
||||
class AW_OT_create_follow_path(bpy.types.Operator):
|
||||
bl_idname = "autowalk.create_follow_path"
|
||||
bl_label = "Create Follow Path Constraint"
|
||||
bl_description = "Create follow path targeting curve chosen in dedicated field"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -63,8 +63,8 @@ class UAC_OT_create_follow_path(bpy.types.Operator):
|
|||
return {"CANCELLED"}
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_snap_curve_to_ground(bpy.types.Operator):
|
||||
bl_idname = "anim.snap_curve_to_ground"
|
||||
class AW_OT_snap_curve_to_ground(bpy.types.Operator):
|
||||
bl_idname = "autowalk.snap_curve_to_ground"
|
||||
bl_label = "Snap Curve"
|
||||
bl_description = "snap curve to ground determine in field"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -81,8 +81,8 @@ class UAC_OT_snap_curve_to_ground(bpy.types.Operator):
|
|||
return {"CANCELLED"}
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_edit_curve(bpy.types.Operator):
|
||||
bl_idname = "uac.edit_curve"
|
||||
class AW_OT_edit_curve(bpy.types.Operator):
|
||||
bl_idname = "autowalk.edit_curve"
|
||||
bl_label = "Edit Curve"
|
||||
bl_description = "Edit curve used as constraint for foot"
|
||||
bl_options = {"REGISTER", "INTERNAL", "UNDO"}
|
||||
|
@ -115,8 +115,8 @@ class UAC_OT_edit_curve(bpy.types.Operator):
|
|||
b.id_data.select_set(False)
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_go_to_object(bpy.types.Operator):
|
||||
bl_idname = "uac.go_to_object"
|
||||
class AW_OT_go_to_object(bpy.types.Operator):
|
||||
bl_idname = "autowalk.go_to_object"
|
||||
bl_label = "Go To Object"
|
||||
bl_description = "Go to object in pose mode"
|
||||
bl_options = {"REGISTER", "INTERNAL"}
|
||||
|
@ -141,8 +141,8 @@ class UAC_OT_go_to_object(bpy.types.Operator):
|
|||
self.report({'INFO'}, f'Back to pose mode {obj.name}')
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_object_from_curve(bpy.types.Operator):
|
||||
bl_idname = "uac.object_from_curve"
|
||||
class AW_OT_object_from_curve(bpy.types.Operator):
|
||||
bl_idname = "autowalk.object_from_curve"
|
||||
bl_label = "Back To Armature"
|
||||
bl_description = "Go in armature pose mode from current curve"
|
||||
bl_options = {"REGISTER", "INTERNAL", "UNDO"}
|
||||
|
@ -187,18 +187,18 @@ class UAC_OT_object_from_curve(bpy.types.Operator):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
for arm, pb in self.armatures:
|
||||
layout.operator('uac.go_to_object', text=f'{arm.name} ({pb.name})', icon='OUTLINER_OB_ARMATURE').obj_name = arm.name
|
||||
layout.operator('autowalk.go_to_object', text=f'{arm.name} ({pb.name})', icon='OUTLINER_OB_ARMATURE').obj_name = arm.name
|
||||
|
||||
def execute(self, context):
|
||||
return {"FINISHED"}
|
||||
|
||||
classes=(
|
||||
UAC_OT_create_curve_path,
|
||||
UAC_OT_create_follow_path,
|
||||
UAC_OT_snap_curve_to_ground,
|
||||
UAC_OT_edit_curve,
|
||||
UAC_OT_go_to_object,
|
||||
UAC_OT_object_from_curve, # use set_choice_id is used to set an index in object_from_curve pop up menu
|
||||
AW_OT_create_curve_path,
|
||||
AW_OT_create_follow_path,
|
||||
AW_OT_snap_curve_to_ground,
|
||||
AW_OT_edit_curve,
|
||||
AW_OT_go_to_object,
|
||||
AW_OT_object_from_curve, # use set_choice_id is used to set an index in object_from_curve pop up menu
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -237,8 +237,8 @@ def snap_feet():
|
|||
# get pb lowest surface deformed point
|
||||
snap_foot(pb, gnd)
|
||||
|
||||
class UAC_OT_contact_to_ground(bpy.types.Operator):
|
||||
bl_idname = "anim.contact_to_ground"
|
||||
class AW_OT_contact_to_ground(bpy.types.Operator):
|
||||
bl_idname = "autowalk.contact_to_ground"
|
||||
bl_label = "Ground Feet"
|
||||
bl_description = "Ground selected feets"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -266,7 +266,7 @@ class UAC_OT_contact_to_ground(bpy.types.Operator):
|
|||
|
||||
|
||||
classes=(
|
||||
UAC_OT_contact_to_ground,
|
||||
AW_OT_contact_to_ground,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -2,8 +2,8 @@ import bpy
|
|||
from . import fn
|
||||
|
||||
|
||||
class UAC_OT_world_space_copy(bpy.types.Operator):
|
||||
bl_idname = "anim.world_space_copy"
|
||||
class AW_OT_world_space_copy(bpy.types.Operator):
|
||||
bl_idname = "autowalk.world_space_copy"
|
||||
bl_label = "World Copy"
|
||||
bl_description = "Copy world space transforms. Store active bone matrix"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -17,8 +17,8 @@ class UAC_OT_world_space_copy(bpy.types.Operator):
|
|||
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_world_space_paste(bpy.types.Operator):
|
||||
bl_idname = "anim.world_space_paste"
|
||||
class AW_OT_world_space_paste(bpy.types.Operator):
|
||||
bl_idname = "autowalk.world_space_paste"
|
||||
bl_label = "World Paste"
|
||||
bl_description = "Paste world space transforms. Apply stored matrix to active bone"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -36,8 +36,8 @@ class UAC_OT_world_space_paste(bpy.types.Operator):
|
|||
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_world_space_paste_next(bpy.types.Operator):
|
||||
bl_idname = "anim.world_space_paste_next"
|
||||
class AW_OT_world_space_paste_next(bpy.types.Operator):
|
||||
bl_idname = "autowalk.world_space_paste_next"
|
||||
bl_label = "World Paste Jump"
|
||||
bl_description = "Paste world space transforms and keyframe available chanels\nThen jump to prev/next key"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -85,8 +85,8 @@ class UAC_OT_world_space_paste_next(bpy.types.Operator):
|
|||
context.scene.frame_current = new_frame
|
||||
return {"FINISHED"}
|
||||
|
||||
class UAC_OT_world_space_paste_next_frame(bpy.types.Operator):
|
||||
bl_idname = "anim.world_space_paste_next_frame"
|
||||
class AW_OT_world_space_paste_next_frame(bpy.types.Operator):
|
||||
bl_idname = "autowalk.world_space_paste_next_frame"
|
||||
bl_label = "World Paste Jump Frame"
|
||||
bl_description = "Paste world space transforms and keyframe available chanels\nThen jump to prev/next frame"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
@ -119,10 +119,10 @@ class UAC_OT_world_space_paste_next_frame(bpy.types.Operator):
|
|||
|
||||
|
||||
classes=(
|
||||
UAC_OT_world_space_copy,
|
||||
UAC_OT_world_space_paste,
|
||||
UAC_OT_world_space_paste_next,
|
||||
UAC_OT_world_space_paste_next_frame,
|
||||
AW_OT_world_space_copy,
|
||||
AW_OT_world_space_paste,
|
||||
AW_OT_world_space_paste_next,
|
||||
AW_OT_world_space_paste_next_frame,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
bl_info = {
|
||||
"name": "Unfold Anim Cycle",
|
||||
"description": "Anim tools to develop walk/run cycles along a curve",
|
||||
"name": "Auto Walk",
|
||||
"description": "Develop a walk/run cycles along a curve and pin feets",
|
||||
"author": "Samuel Bernou",
|
||||
"version": (1, 2, 0),
|
||||
"version": (1, 3, 0),
|
||||
"blender": (3, 0, 0),
|
||||
"location": "View3D",
|
||||
"warning": "",
|
||||
"doc_url": "https://gitlab.com/autour-de-minuit/blender/unfold_anim_cycle",
|
||||
"doc_url": "https://gitlab.com/autour-de-minuit/blender/auto_walk",
|
||||
"category": "Object"}
|
||||
|
||||
if 'bpy' in locals():
|
||||
|
|
78
panels.py
78
panels.py
|
@ -1,11 +1,11 @@
|
|||
import bpy
|
||||
from . import fn
|
||||
|
||||
class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
||||
class AW_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Walk"
|
||||
bl_label = "Walk Cycle Anim"
|
||||
bl_label = "Auto Walk"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -23,9 +23,9 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
row = col.row()
|
||||
row.label(text='Forward Axis')
|
||||
row.prop(settings, "forward_axis", text='')
|
||||
row.operator('uac.open_addon_prefs', icon='PREFERENCES', text='')
|
||||
col.operator("uac.autoset_axis", text='Auto-Set Axis') # maybe check for fcruve cycle at the end of autoset axis ? (like a check)
|
||||
col.operator("uac.create_cycles_modifiers", text='Add Cycles Modifiers', icon='GRAPH')
|
||||
row.operator('autowalk.open_addon_prefs', icon='PREFERENCES', text='')
|
||||
col.operator("autowalk.autoset_axis", text='Auto-Set Axis') # maybe check for fcruve cycle at the end of autoset axis ? (like a check)
|
||||
col.operator("autowalk.create_cycles_modifiers", text='Add Cycles Modifiers', icon='GRAPH')
|
||||
|
||||
pb = None
|
||||
constrained = False
|
||||
|
@ -37,23 +37,23 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
constrained = True
|
||||
|
||||
if not settings.path_to_follow and not constrained:
|
||||
layout.operator('anim.create_curve_path', text='Create Curve at Root Position', icon='CURVE_BEZCURVE')
|
||||
layout.operator('autowalk.create_curve_path', text='Create Curve at Root Position', icon='CURVE_BEZCURVE')
|
||||
if (w_co := context.scene.collection.children.get('walk_markers')) and w_co.objects:
|
||||
row=layout.row(align=True)
|
||||
row.label(text=f"1st Point Frame {w_co.objects[0].name.split('_')[-1]}")
|
||||
row.operator('anim.remove_a_b_step', text='', icon='X') # Remove
|
||||
layout.operator('anim.create_a_b_step', text='Set 2nd Point', icon='CURVE_PATH')
|
||||
row.operator('autowalk.remove_a_b_step', text='', icon='X') # Remove
|
||||
layout.operator('autowalk.create_a_b_step', text='Set 2nd Point', icon='CURVE_PATH')
|
||||
else:
|
||||
layout.operator('anim.create_a_b_step', text='Set 1st Point', icon='CURVE_PATH')
|
||||
layout.operator('autowalk.create_a_b_step', text='Set 1st Point', icon='CURVE_PATH')
|
||||
|
||||
else:
|
||||
layout.operator('uac.edit_curve', text='Edit Curve', icon='OUTLINER_DATA_CURVE') # FORCE_CURVE
|
||||
layout.operator('autowalk.edit_curve', text='Edit Curve', icon='OUTLINER_DATA_CURVE') # FORCE_CURVE
|
||||
|
||||
elif ob and ob.type == 'CURVE':
|
||||
if context.mode in ('OBJECT', 'EDIT_CURVE') \
|
||||
and settings.path_to_follow \
|
||||
and ob == settings.path_to_follow:
|
||||
layout.operator('uac.object_from_curve', text='Back To Object', icon='LOOP_BACK')
|
||||
layout.operator('autowalk.object_from_curve', text='Back To Object', icon='LOOP_BACK')
|
||||
|
||||
box = layout.box()
|
||||
expand_icon = 'TRIA_DOWN' if tweak else 'TRIA_RIGHT'
|
||||
|
@ -66,7 +66,7 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
box.prop_search(settings, "gnd", context.scene, "objects")
|
||||
|
||||
row = box.row()
|
||||
row.operator('anim.snap_curve_to_ground', text='Snap curve to ground', icon='SNAP_ON')
|
||||
row.operator('autowalk.snap_curve_to_ground', text='Snap curve to ground', icon='SNAP_ON')
|
||||
row.active = bool(settings.gnd)
|
||||
|
||||
|
||||
|
@ -83,7 +83,7 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
## Put this in a setting popup or submenu
|
||||
# if context.mode == 'POSE':
|
||||
if not constrained:
|
||||
box.operator('anim.create_follow_path', text='Add follow path constraint', icon='CON_FOLLOWPATH')
|
||||
box.operator('autowalk.create_follow_path', text='Add follow path constraint', icon='CON_FOLLOWPATH')
|
||||
|
||||
|
||||
box = layout.box()
|
||||
|
@ -91,10 +91,10 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
col.label(text='Motion:')
|
||||
col.prop(settings, "start_frame", text='Start')
|
||||
# col.prop(settings, "foot_axis", text='Foot Axis')
|
||||
col.operator('anim.animate_path', text='Animate Forward Motion', icon='ANIM')
|
||||
col.operator('autowalk.animate_path', text='Animate Forward Motion', icon='ANIM')
|
||||
|
||||
row=col.row()
|
||||
row.operator('anim.adjust_animation_length', text='Adjust Forward Speed', icon='MOD_TIME')
|
||||
row.operator('autowalk.adjust_animation_length', text='Adjust Forward Speed', icon='MOD_TIME')
|
||||
|
||||
## Bake cycle (on selected)
|
||||
box = layout.box()
|
||||
|
@ -106,10 +106,10 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
row.prop(settings, "expand_on_selected_bones")
|
||||
|
||||
txt = 'Bake keys' if settings.linear else 'Bake keys and step path'
|
||||
col.operator('anim.bake_cycle_and_step', text=txt, icon='SHAPEKEY_DATA')
|
||||
col.operator('autowalk.bake_cycle_and_step', text=txt, icon='SHAPEKEY_DATA')
|
||||
|
||||
# Pin feet
|
||||
col.operator('anim.pin_feets', text='Pin feets', icon='PINNED')
|
||||
col.operator('autowalk.pin_feets', text='Pin feets', icon='PINNED')
|
||||
|
||||
## show a dropdown allowing to go back to unpinned, unbaked version of the animation
|
||||
if ob and ob.type == 'ARMATURE':
|
||||
|
@ -118,40 +118,40 @@ class UAC_PT_walk_cycle_anim_panel(bpy.types.Panel):
|
|||
# skipped if in NLA tweak mode because anim.is_property_readonly('action') = True
|
||||
if 'baked' in anim.action.name or 'pinned' in anim.action.name:
|
||||
col=box.column()
|
||||
col.operator('uac.step_back_actions', text='Use Previous Actions', icon= 'ACTION')
|
||||
col.operator('autowalk.step_back_actions', text='Use Previous Actions', icon= 'ACTION')
|
||||
|
||||
class UAC_PT_anim_tools_panel(bpy.types.Panel):
|
||||
class AW_PT_anim_tools_panel(bpy.types.Panel):
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Walk"
|
||||
bl_label = "Tools"
|
||||
bl_label = "Walk Tools"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator('anim.contact_to_ground', text='Ground selected feet', icon='SNAP_OFF')
|
||||
layout.operator('autowalk.contact_to_ground', text='Ground selected feet', icon='SNAP_OFF')
|
||||
row = layout.row()
|
||||
row.operator('anim.world_space_copy', text='Copy Pose', icon='COPYDOWN')
|
||||
# row.operator('anim.world_space_paste', text='Paste', icon='PASTEDOWN')
|
||||
row.operator('autowalk.world_space_copy', text='Copy Pose', icon='COPYDOWN')
|
||||
# row.operator('autowalk.world_space_paste', text='Paste', icon='PASTEDOWN')
|
||||
# row = layout.row(align=False)
|
||||
|
||||
## multi buttons
|
||||
# row.label(text='Paste and jump:')
|
||||
# row = layout.row(align=True)
|
||||
# row.operator('anim.world_space_paste_next', text='Prev key', icon='PREV_KEYFRAME').prev = True # Paste Prev key
|
||||
# row.operator('anim.world_space_paste_next', text='Next key', icon='NEXT_KEYFRAME').prev = False # Paste Next key
|
||||
# row.operator('autowalk.world_space_paste_next', text='Prev key', icon='PREV_KEYFRAME').prev = True # Paste Prev key
|
||||
# row.operator('autowalk.world_space_paste_next', text='Next key', icon='NEXT_KEYFRAME').prev = False # Paste Next key
|
||||
# row = layout.row(align=True)
|
||||
# row.operator('anim.world_space_paste_next_frame', text='Prev frame', icon='FRAME_PREV').prev = True # Paste Prev frame
|
||||
# row.operator('anim.world_space_paste_next_frame', text='Next frame', icon='FRAME_NEXT').prev = False # Paste Next frame
|
||||
# row.operator('autowalk.world_space_paste_next_frame', text='Prev frame', icon='FRAME_PREV').prev = True # Paste Prev frame
|
||||
# row.operator('autowalk.world_space_paste_next_frame', text='Next frame', icon='FRAME_NEXT').prev = False # Paste Next frame
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator('anim.world_space_paste_next_frame', text='', icon='FRAME_PREV').prev = True
|
||||
row.operator('anim.world_space_paste_next', text='', icon='PREV_KEYFRAME').prev = True
|
||||
row.operator('anim.world_space_paste', text='', icon='PASTEDOWN')
|
||||
row.operator('anim.world_space_paste_next', text='', icon='NEXT_KEYFRAME').prev = False
|
||||
row.operator('anim.world_space_paste_next_frame', text='', icon='FRAME_NEXT').prev = False
|
||||
row.operator('autowalk.world_space_paste_next_frame', text='', icon='FRAME_PREV').prev = True
|
||||
row.operator('autowalk.world_space_paste_next', text='', icon='PREV_KEYFRAME').prev = True
|
||||
row.operator('autowalk.world_space_paste', text='', icon='PASTEDOWN')
|
||||
row.operator('autowalk.world_space_paste_next', text='', icon='NEXT_KEYFRAME').prev = False
|
||||
row.operator('autowalk.world_space_paste_next_frame', text='', icon='FRAME_NEXT').prev = False
|
||||
row.scale_x = 2
|
||||
|
||||
class UAC_PT_nla_tools_panel(bpy.types.Panel):
|
||||
class AW_PT_nla_tools_panel(bpy.types.Panel):
|
||||
bl_space_type = "NLA_EDITOR"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "Strip"
|
||||
|
@ -160,19 +160,19 @@ class UAC_PT_nla_tools_panel(bpy.types.Panel):
|
|||
def draw(self, context):
|
||||
layout = self.layout
|
||||
# layout.label(text='Retime Tools')
|
||||
layout.operator('anim.nla_key_speed', text='Set Time Keys', icon='TIME')
|
||||
layout.operator('autowalk.nla_key_speed', text='Set Time Keys', icon='TIME')
|
||||
|
||||
|
||||
|
||||
classes=(
|
||||
UAC_PT_walk_cycle_anim_panel,
|
||||
UAC_PT_anim_tools_panel,
|
||||
UAC_PT_nla_tools_panel,
|
||||
AW_PT_walk_cycle_anim_panel,
|
||||
AW_PT_anim_tools_panel,
|
||||
AW_PT_nla_tools_panel,
|
||||
)
|
||||
|
||||
classes_override_category =(
|
||||
UAC_PT_walk_cycle_anim_panel,
|
||||
UAC_PT_anim_tools_panel,
|
||||
AW_PT_walk_cycle_anim_panel,
|
||||
AW_PT_anim_tools_panel,
|
||||
)
|
||||
|
||||
## Addons Preferences Update Panel
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import bpy
|
||||
from .panels import update_panel
|
||||
from . import fn
|
||||
class UAC_OT_open_addon_prefs(bpy.types.Operator):
|
||||
bl_idname = "uac.open_addon_prefs"
|
||||
class AW_OT_open_addon_prefs(bpy.types.Operator):
|
||||
bl_idname = "autowalk.open_addon_prefs"
|
||||
bl_label = "Open Addon Prefs"
|
||||
bl_description = "Open user preferences window in addon tab and prefill the search with addon name"
|
||||
bl_options = {"REGISTER", "INTERNAL"}
|
||||
|
@ -10,7 +10,8 @@ class UAC_OT_open_addon_prefs(bpy.types.Operator):
|
|||
def execute(self, context):
|
||||
fn.open_addon_prefs()
|
||||
return {'FINISHED'}
|
||||
class UAC_addon_prefs(bpy.types.AddonPreferences):
|
||||
|
||||
class AW_addon_prefs(bpy.types.AddonPreferences):
|
||||
## can be just __name__ if prefs are in the __init__ mainfile
|
||||
# Else need the splitext '__name__ = addonname.subfile' (or use a static name)
|
||||
bl_idname = __name__.split('.')[0] # or with: os.path.splitext(__name__)[0]
|
||||
|
@ -66,8 +67,8 @@ class UAC_addon_prefs(bpy.types.AddonPreferences):
|
|||
layout.prop(self, "debug")
|
||||
|
||||
classes = (
|
||||
UAC_addon_prefs,
|
||||
UAC_OT_open_addon_prefs,
|
||||
AW_addon_prefs,
|
||||
AW_OT_open_addon_prefs,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
|
|
@ -7,7 +7,7 @@ from bpy.props import (
|
|||
EnumProperty,
|
||||
)
|
||||
|
||||
class UAC_PG_settings(bpy.types.PropertyGroup) :
|
||||
class AW_PG_settings(bpy.types.PropertyGroup) :
|
||||
## HIDDEN to hide the animatable dot thing
|
||||
|
||||
tweak : bpy.props.BoolProperty(
|
||||
|
@ -68,9 +68,9 @@ class UAC_PG_settings(bpy.types.PropertyGroup) :
|
|||
"""
|
||||
|
||||
def register():
|
||||
bpy.utils.register_class(UAC_PG_settings)
|
||||
bpy.types.Scene.anim_cycle_settings = bpy.props.PointerProperty(type = UAC_PG_settings)
|
||||
bpy.utils.register_class(AW_PG_settings)
|
||||
bpy.types.Scene.anim_cycle_settings = bpy.props.PointerProperty(type = AW_PG_settings)
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(UAC_PG_settings)
|
||||
bpy.utils.unregister_class(AW_PG_settings)
|
||||
del bpy.types.Scene.anim_cycle_settings
|
Loading…
Reference in New Issue