bone_widget/__init__.py

74 lines
1.5 KiB
Python
Raw Normal View History

2022-10-28 23:23:06 +02:00
bl_info = {
"name": "Bone Widget",
"author": "Christophe SEUX",
2023-01-18 16:02:42 +01:00
"version": (2, 0, 1),
"blender": (3, 4, 1),
2022-10-28 23:23:06 +02:00
"description": "Create custom shapes for bone controller",
"warning": "",
"wiki_url": "",
"category": "Rigging",
}
import sys
2023-01-18 16:02:42 +01:00
2022-10-28 23:23:06 +02:00
if "bpy" in locals():
import importlib as imp
imp.reload(context)
2023-01-18 16:02:42 +01:00
sys.modules.update({"bone_widget.ctx": context.BW_context()})
imp.reload(shape_utils)
imp.reload(transform_utils)
imp.reload(icon_utils)
2022-10-28 23:23:06 +02:00
imp.reload(properties)
imp.reload(operators)
imp.reload(ui)
2023-01-18 16:02:42 +01:00
2022-10-28 23:23:06 +02:00
else:
from . import context
2023-01-18 16:02:42 +01:00
sys.modules.update({"bone_widget.ctx": context.BW_context()})
2022-10-28 23:23:06 +02:00
from . import operators
from . import ui
from . import properties
2023-01-18 16:02:42 +01:00
from . import shape_utils
from . import transform_utils
from . import icon_utils
2022-10-28 23:23:06 +02:00
import bpy
2023-01-18 16:02:42 +01:00
import sys
2022-10-28 23:23:06 +02:00
#sys.modules.update({"bone_widget.ctx": context.BW_ctx()})
2023-01-18 16:02:42 +01:00
2022-10-28 23:23:06 +02:00
def register():
properties.register()
operators.register()
ui.register()
#bpy.types.Scene.bone_widget = bpy.props.PointerProperty(type=BoneWidgetSettings)
#get_widgets(DefaultFolder, DefaultShapes)
#get_widgets(CustomFolder, CustomShapes)
2023-02-06 15:10:00 +01:00
sys.modules.update({"bone_widget.ctx": context.BW_context()})
2023-01-18 16:02:42 +01:00
from bone_widget import ctx
2022-10-28 23:23:06 +02:00
for f in ctx.folders:
f.load_widgets()
def unregister():
#print('UnRegister BoneWidget')
properties.unregister()
operators.unregister()
ui.unregister()
del sys.modules['bone_widget.ctx']
#remove_icons(bpy.types.Scene.bone_widget)