Remove obsolete implementation and simplify project structure
This commit is contained in:
56
src/anyimage/__init__.py
Normal file
56
src/anyimage/__init__.py
Normal file
@@ -0,0 +1,56 @@
|
||||
import bpy
|
||||
|
||||
from .runtime import runtime
|
||||
from .operators import CLASSES as OPERATOR_CLASSES
|
||||
from .operators.balloon import BalloonTool
|
||||
from .preferences import AnyImagePreferences
|
||||
from .properties import AnyImageSettings
|
||||
from .menu import AnyImageImageMenu, draw_image_context_menu
|
||||
from .panel import (
|
||||
Ben2RemovalDebugPanel,
|
||||
Da3OutputDebugPanel,
|
||||
DebugPanel,
|
||||
ModelsPanel,
|
||||
Moge2ApiDebugPanel,
|
||||
ServerPanel,
|
||||
)
|
||||
|
||||
|
||||
CLASSES = (
|
||||
AnyImagePreferences,
|
||||
AnyImageSettings,
|
||||
*OPERATOR_CLASSES,
|
||||
AnyImageImageMenu,
|
||||
ServerPanel,
|
||||
ModelsPanel,
|
||||
DebugPanel,
|
||||
Moge2ApiDebugPanel,
|
||||
Da3OutputDebugPanel,
|
||||
Ben2RemovalDebugPanel,
|
||||
)
|
||||
|
||||
|
||||
def register():
|
||||
for class_type in CLASSES:
|
||||
bpy.utils.register_class(class_type)
|
||||
bpy.utils.register_tool(
|
||||
BalloonTool,
|
||||
separator=False,
|
||||
)
|
||||
bpy.types.Scene.anyimage_settings = bpy.props.PointerProperty(
|
||||
type=AnyImageSettings,
|
||||
)
|
||||
bpy.types.VIEW3D_MT_object_context_menu.append(draw_image_context_menu)
|
||||
bpy.types.OUTLINER_MT_object.append(draw_image_context_menu)
|
||||
runtime.register()
|
||||
|
||||
|
||||
def unregister():
|
||||
runtime.unregister()
|
||||
bpy.utils.unregister_tool(BalloonTool)
|
||||
bpy.types.VIEW3D_MT_object_context_menu.remove(draw_image_context_menu)
|
||||
bpy.types.OUTLINER_MT_object.remove(draw_image_context_menu)
|
||||
if hasattr(bpy.types.Scene, "anyimage_settings"):
|
||||
del bpy.types.Scene.anyimage_settings
|
||||
for class_type in reversed(CLASSES):
|
||||
bpy.utils.unregister_class(class_type)
|
||||
Reference in New Issue
Block a user