auto_walk/__init__.py

92 lines
2.2 KiB
Python
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0-or-later
2021-04-05 01:35:12 +02:00
bl_info = {
2021-04-05 01:39:27 +02:00
"name": "Unfold Anim Cycle",
2022-03-29 18:46:33 +02:00
"description": "Anim tools to develop walk/run cycles along a curve",
2021-04-05 01:35:12 +02:00
"author": "Samuel Bernou",
"version": (1, 2, 0),
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": "",
2021-04-05 01:39:27 +02:00
"doc_url": "https://gitlab.com/autour-de-minuit/blender/unfold_anim_cycle",
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():
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)
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)
imp.reload(OP_nla_tweak)
2021-04-08 19:25:05 +02:00
imp.reload(panels)
else:
2022-03-29 18:46:33 +02:00
from . import properties
from . import preferences
from . import OP_setup
from . import OP_setup_curve_path
from . import OP_setup_curve_a_to_b
from . import OP_animate_path
from . import OP_expand_cycle_step
from . import OP_snap_contact
from . import OP_world_copy_paste
from . import OP_nla_tweak
from . import panels
2021-04-08 19:25:05 +02:00
import bpy
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,
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,
OP_nla_tweak,
2022-03-29 18:46:33 +02:00
panels,
2021-04-05 01:35:12 +02:00
)
from bpy.app.handlers import persistent
## 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-03-29 18:46:33 +02:00
for module in mods:
module.register()
prefs = fn.get_addon_prefs()
panels.update_panel(prefs, bpy.context)
# bpy.app.handlers.load_post.append(set_target_bone)
2021-04-05 01:35:12 +02:00
def unregister():
2022-03-29 18:46:33 +02:00
if bpy.app.background:
return
# 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()