2022-04-11 19:46:22 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2021-04-05 01:35:12 +02:00
|
|
|
bl_info = {
|
2022-04-20 12:02:19 +02:00
|
|
|
"name": "Auto Walk",
|
|
|
|
"description": "Develop a walk/run cycles along a curve and pin feets",
|
2021-04-05 01:35:12 +02:00
|
|
|
"author": "Samuel Bernou",
|
2023-03-09 11:18:44 +01:00
|
|
|
"version": (1, 8, 1),
|
2022-03-29 18:46:33 +02:00
|
|
|
"blender": (3, 0, 0),
|
2021-04-05 01:35:12 +02:00
|
|
|
"location": "View3D",
|
2022-04-13 19:34:12 +02:00
|
|
|
"warning": "",
|
2022-04-20 12:02:19 +02:00
|
|
|
"doc_url": "https://gitlab.com/autour-de-minuit/blender/auto_walk",
|
2022-03-31 17:07:04 +02:00
|
|
|
"category": "Object"}
|
2021-04-05 01:35:12 +02:00
|
|
|
|
2021-04-08 19:25:05 +02:00
|
|
|
if 'bpy' in locals():
|
2021-05-10 16:51:16 +02:00
|
|
|
import importlib as imp
|
2022-03-29 18:46:33 +02:00
|
|
|
imp.reload(properties)
|
|
|
|
imp.reload(preferences)
|
|
|
|
imp.reload(OP_setup)
|
2021-04-08 19:25:05 +02:00
|
|
|
imp.reload(OP_setup_curve_path)
|
2022-04-19 15:33:06 +02:00
|
|
|
imp.reload(OP_setup_curve_a_to_b)
|
2021-04-08 19:25:05 +02:00
|
|
|
imp.reload(OP_animate_path)
|
|
|
|
imp.reload(OP_expand_cycle_step)
|
|
|
|
imp.reload(OP_snap_contact)
|
|
|
|
imp.reload(OP_world_copy_paste)
|
2023-03-08 17:59:49 +01:00
|
|
|
imp.reload(OP_wrap_anim)
|
2022-04-13 18:38:03 +02:00
|
|
|
imp.reload(OP_nla_tweak)
|
2021-04-08 19:25:05 +02:00
|
|
|
imp.reload(panels)
|
2021-05-10 16:51:16 +02:00
|
|
|
else:
|
2022-03-29 18:46:33 +02:00
|
|
|
from . import properties
|
|
|
|
from . import preferences
|
|
|
|
from . import OP_setup
|
2021-05-10 16:51:16 +02:00
|
|
|
from . import OP_setup_curve_path
|
2022-04-19 15:33:06 +02:00
|
|
|
from . import OP_setup_curve_a_to_b
|
2021-05-10 16:51:16 +02:00
|
|
|
from . import OP_animate_path
|
|
|
|
from . import OP_expand_cycle_step
|
|
|
|
from . import OP_snap_contact
|
|
|
|
from . import OP_world_copy_paste
|
2023-03-08 17:59:49 +01:00
|
|
|
from . import OP_wrap_anim
|
2022-04-13 18:38:03 +02:00
|
|
|
from . import OP_nla_tweak
|
2021-05-10 16:51:16 +02:00
|
|
|
from . import panels
|
2021-04-08 19:25:05 +02:00
|
|
|
|
2021-05-10 16:51:16 +02:00
|
|
|
import bpy
|
2022-04-12 11:21:00 +02:00
|
|
|
from . import fn
|
2021-04-05 01:35:12 +02:00
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
mods = (
|
|
|
|
properties,
|
|
|
|
preferences,
|
|
|
|
OP_setup,
|
|
|
|
OP_setup_curve_path,
|
2022-04-19 15:33:06 +02:00
|
|
|
OP_setup_curve_a_to_b,
|
2022-03-29 18:46:33 +02:00
|
|
|
OP_animate_path,
|
|
|
|
OP_expand_cycle_step,
|
|
|
|
OP_snap_contact,
|
|
|
|
OP_world_copy_paste,
|
2023-03-08 17:59:49 +01:00
|
|
|
OP_wrap_anim,
|
2022-04-13 18:38:03 +02:00
|
|
|
OP_nla_tweak,
|
2022-03-29 18:46:33 +02:00
|
|
|
panels,
|
2021-04-05 01:35:12 +02:00
|
|
|
)
|
|
|
|
|
2022-04-13 18:38:03 +02:00
|
|
|
from bpy.app.handlers import persistent
|
2022-04-12 11:21:00 +02:00
|
|
|
|
|
|
|
|
2022-04-13 18:38:03 +02:00
|
|
|
## Not
|
|
|
|
# @persistent
|
|
|
|
# def set_target_bone(scene):
|
|
|
|
# # prefill constrained bone field
|
|
|
|
# settings = bpy.context.scene.anim_cycle_settings
|
|
|
|
# if not settings.tgt_bone:
|
|
|
|
# settings.tgt_bone = fn.get_addon_prefs().tgt_bone
|
|
|
|
|
|
|
|
|
2021-04-05 01:35:12 +02:00
|
|
|
def register():
|
2022-03-29 18:46:33 +02:00
|
|
|
if bpy.app.background:
|
|
|
|
return
|
2022-04-13 18:38:03 +02:00
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
for module in mods:
|
|
|
|
module.register()
|
2022-04-13 18:38:03 +02:00
|
|
|
|
|
|
|
prefs = fn.get_addon_prefs()
|
|
|
|
panels.update_panel(prefs, bpy.context)
|
|
|
|
|
|
|
|
# bpy.app.handlers.load_post.append(set_target_bone)
|
2022-04-12 11:21:00 +02:00
|
|
|
|
2021-04-05 01:35:12 +02:00
|
|
|
def unregister():
|
2022-03-29 18:46:33 +02:00
|
|
|
if bpy.app.background:
|
|
|
|
return
|
2022-04-13 18:38:03 +02:00
|
|
|
|
|
|
|
# bpy.app.handlers.load_post.remove(set_target_bone)
|
|
|
|
|
2022-03-29 18:46:33 +02:00
|
|
|
for module in reversed(mods):
|
|
|
|
module.unregister()
|
2021-04-05 01:35:12 +02:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|