Add tests for clipboard image functionality and mesh plane asset creation

- Implemented a comprehensive test suite for the clipboard image module, covering various functionalities including operator registration, context handling, and image processing.
- Created a new mesh plane asset with customizable parameters and integrated it into the geometry node system.
- Developed a validation script to ensure the correct behavior of the mesh plane asset, including input handling and output verification.
This commit is contained in:
2026-08-22 09:49:00 +08:00
parent af5603045c
commit 988332548e
49 changed files with 4419 additions and 291 deletions

View File

@@ -8,61 +8,44 @@ class AnyImageImageMenu(bpy.types.Menu):
bl_label = "AnyImage"
def draw(self, _context):
from .runtime import runtime
from .properties import required_models_ready
from .properties import ai_setup_label, ai_status
layout = self.layout
layout.operator_context = "INVOKE_DEFAULT"
layout.operator(
"anyimage.activate_balloon_tool",
text="Balloon Lasso Tool",
icon="MOD_SKIN",
"anyimage.convert_to_mesh_plane",
text="Convert to Mesh Plane…",
icon="MESH_PLANE",
)
layout.separator()
environment_ready = runtime.environment_ready()
if not environment_ready:
layout.operator(
"anyimage.install_environment",
text="Install Environment",
icon="IMPORT",
)
layout.operator(
"anyimage.install_environment_mirror",
text="Install Environment (Mirror)",
icon="IMPORT",
)
models_ready = required_models_ready()
if environment_ready and not models_ready:
layout.operator(
"anyimage.download_required_models",
text="Download Required Models",
icon="IMPORT",
)
features_ready = environment_ready and models_ready
if not features_ready:
layout.separator()
depth_plane_row = layout.row()
depth_plane_row.enabled = features_ready
depth_plane_row.operator(
layout.operator(
"anyimage.convert_to_depth_plane",
text="Convert to Depth Plane",
text="Convert to Depth Plane…",
icon="MOD_DISPLACE",
)
surface_row = layout.row()
surface_row.enabled = features_ready
surface_row.operator(
layout.operator(
"anyimage.convert_to_surface",
text="Convert to Surface",
text="Convert to Surface…",
icon="MESH_GRID",
)
layout.separator()
background_row = layout.row()
background_row.enabled = features_ready
background_row.operator(
layout.operator(
"anyimage.remove_image_background",
text="Remove Background",
icon="IMAGE_ALPHA",
)
layout.separator()
status = ai_status()
if status["ready"]:
layout.operator(
"anyimage.open_ai_environment_settings",
text="AI Environment Settings…",
icon="PREFERENCES",
)
else:
layout.operator(
"anyimage.setup_ai_environment",
text=ai_setup_label(status),
icon="IMPORT",
)
def draw_image_context_menu(self, context):