Files
AnyImage/src/snapform/__init__.py
nan 6d4d1c4ec2 Refactor and enhance DA3 and BEN2 debug panels, introduce mesh export functionality
- Renamed DA3 and BEN2 debug panels for clarity and consistency.
- Added a new function to draw DA3 input settings to reduce code duplication.
- Implemented mesh export functionality, including confidence thresholding and edge filtering.
- Updated export format options to include new mesh type and adjusted related properties.
- Enhanced job handling to move generated inputs into job root and manage temporary directories.
- Improved error handling and file management during export processes.
- Added unit tests for new mesh functionality and ensured existing tests cover changes.
2026-08-09 21:31:08 +08:00

72 lines
1.7 KiB
Python

import bpy
from . import runtime
from .image_depth import (
ApplyRemovedBackground,
BuildDepthPlane,
BuildOriginalDepthPlane,
ConvertImageToDepthPlane,
RemoveImageBackground,
draw_image_context_menu,
)
from .operators import (
CancelJob,
ControlHost,
RunJob,
cancel_active_job,
close_active_job,
)
from .panel import (
Ben2RemovalDebugPanel,
Da3OutputDebugPanel,
DebugPanel,
HostPanel,
ModelsPanel,
)
from .preferences import SnapFormPreferences
from .properties import SnapFormSettings
from .status_bar import draw_status_bar
CLASSES = (
SnapFormPreferences,
SnapFormSettings,
RunJob,
CancelJob,
ControlHost,
ApplyRemovedBackground,
RemoveImageBackground,
BuildDepthPlane,
BuildOriginalDepthPlane,
ConvertImageToDepthPlane,
HostPanel,
ModelsPanel,
DebugPanel,
Da3OutputDebugPanel,
Ben2RemovalDebugPanel,
)
def register():
for class_type in CLASSES:
bpy.utils.register_class(class_type)
bpy.types.Scene.snapform_settings = bpy.props.PointerProperty(
type=SnapFormSettings,
)
bpy.types.STATUSBAR_HT_header.append(draw_status_bar)
bpy.types.VIEW3D_MT_object_context_menu.append(draw_image_context_menu)
runtime.schedule_host_start()
def unregister():
cancel_active_job()
close_active_job()
runtime.unschedule_host()
runtime.detach_host_client()
bpy.types.VIEW3D_MT_object_context_menu.remove(draw_image_context_menu)
bpy.types.STATUSBAR_HT_header.remove(draw_status_bar)
if hasattr(bpy.types.Scene, "snapform_settings"):
del bpy.types.Scene.snapform_settings
for class_type in reversed(CLASSES):
bpy.utils.unregister_class(class_type)