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

@@ -1,7 +1,13 @@
import bpy
from .runtime import DEFAULT_STORAGE_ROOT, runtime
from .properties import device_enum_items
from .properties import (
BEN2_MODEL_KEY,
ai_setup_label,
ai_status,
device_enum_items,
model_catalog,
)
class AnyImagePreferences(bpy.types.AddonPreferences):
@@ -31,27 +37,60 @@ class AnyImagePreferences(bpy.types.AddonPreferences):
layout.prop(self, "storage_root")
layout.prop(self, "device")
layout.separator()
status = ai_status()
layout.label(text=f"Environment: {runtime.environment_directory()}")
if runtime.environment_ready():
layout.label(text="Environment is installed", icon="CHECKMARK")
if not status["environment_ready"]:
layout.label(text="Environment is not installed", icon="ERROR")
setup_row = layout.row()
setup_row.enabled = not runtime.server_busy()
setup_row.operator(
"anyimage.setup_ai_environment",
text=ai_setup_label(status),
icon="IMPORT",
)
else:
install_row = layout.row()
install_row.enabled = runtime.active_job is None
install_row.operator(
"anyimage.install_environment",
text="Install Environment",
icon="IMPORT",
)
mirror_row = layout.row()
mirror_row.enabled = runtime.active_job is None
mirror_row.operator(
"anyimage.install_environment_mirror",
text="Install Environment (Mirror)",
icon="IMPORT",
layout.label(text="Environment is installed", icon="CHECKMARK")
if not status["ready"]:
required_row = layout.row()
required_row.enabled = not runtime.server_busy()
required_row.operator(
"anyimage.setup_ai_environment",
text=ai_setup_label(status),
icon="IMPORT",
)
layout.separator(type="LINE")
layout.label(text="Models")
models = model_catalog()
for family in ("moge2", "da3"):
for model in models:
if model.get("family") == family and (
family != "da3" or model.get("enabled")
):
self._draw_model(layout, model)
ben2 = next(
(model for model in models if model.get("key") == BEN2_MODEL_KEY),
None,
)
if ben2:
self._draw_model(layout, ben2)
layout.separator()
layout.operator(
"anyimage.open_server_log",
text="Open Server Log",
icon="TEXT",
)
def _draw_model(self, layout, model):
row = layout.row(align=True)
row.label(text=model["label"])
if model.get("ready"):
row.label(text="Ready", icon="CHECKMARK")
return
download_row = row.row(align=True)
download_row.enabled = not runtime.server_busy()
operator = download_row.operator(
"anyimage.download_model",
text="Download",
icon="IMPORT",
)
operator.model = model["key"]