- Implemented a new geometry nodes asset in `build_geometry_nodes_asset.py` to handle mesh refinement and topology fixing. - Created a validation script in `validate_geometry_nodes_asset.py` to ensure the integrity and functionality of the geometry node group. - Added input handling for various parameters including resolution, iterations, and smoothing options. - Included checks for node group structure and attributes to validate the geometry processing pipeline.
77 lines
1.9 KiB
Python
77 lines
1.9 KiB
Python
import bpy
|
|
|
|
from . import runtime
|
|
from .image_depth import (
|
|
ApplyRemovedBackground,
|
|
BuildDepthPlane,
|
|
BuildOriginalDepthPlane,
|
|
ConvertImageToDepthPlane,
|
|
RemoveImageBackground,
|
|
SnapFormImageMenu,
|
|
draw_image_context_menu,
|
|
)
|
|
from .image_mesh import BuildImageMesh, ConvertImageToMesh
|
|
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,
|
|
SnapFormImageMenu,
|
|
ApplyRemovedBackground,
|
|
RemoveImageBackground,
|
|
BuildDepthPlane,
|
|
BuildOriginalDepthPlane,
|
|
ConvertImageToDepthPlane,
|
|
BuildImageMesh,
|
|
ConvertImageToMesh,
|
|
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)
|