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:
@@ -1,7 +1,7 @@
|
||||
import bpy
|
||||
|
||||
from .runtime import runtime
|
||||
from .properties import BEN2_MODEL_KEY, model_catalog, model_ready
|
||||
from .properties import BEN2_MODEL_KEY, model_ready
|
||||
|
||||
class ServerPanel(bpy.types.Panel):
|
||||
bl_label = "Job Server"
|
||||
@@ -19,18 +19,11 @@ class ServerPanel(bpy.types.Panel):
|
||||
text="Environment is not installed",
|
||||
icon="ERROR",
|
||||
)
|
||||
install_row = layout.row()
|
||||
install_row.enabled = not running
|
||||
install_row.operator(
|
||||
"anyimage.install_environment",
|
||||
text="Install Environment",
|
||||
icon="IMPORT",
|
||||
)
|
||||
mirror_row = layout.row()
|
||||
mirror_row.enabled = not running
|
||||
mirror_row.operator(
|
||||
"anyimage.install_environment_mirror",
|
||||
text="Install Environment (Mirror)",
|
||||
setup_row = layout.row()
|
||||
setup_row.enabled = not running
|
||||
setup_row.operator(
|
||||
"anyimage.setup_ai_environment",
|
||||
text="Set Up AI Environment…",
|
||||
icon="IMPORT",
|
||||
)
|
||||
return
|
||||
@@ -109,54 +102,6 @@ class ServerPanel(bpy.types.Panel):
|
||||
)
|
||||
|
||||
|
||||
class ModelsPanel(bpy.types.Panel):
|
||||
bl_label = "Models"
|
||||
bl_idname = "ANYIMAGE_PT_models"
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_region_type = "UI"
|
||||
bl_category = "AnyImage"
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
bl_order = 1
|
||||
|
||||
@classmethod
|
||||
def poll(cls, _context):
|
||||
return runtime.environment_ready()
|
||||
|
||||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
running = runtime.server_busy()
|
||||
|
||||
models = model_catalog()
|
||||
for model in models:
|
||||
if model.get("family") == "moge2":
|
||||
self._draw_model(layout, model, running)
|
||||
for model in models:
|
||||
if model.get("family") == "da3" and model.get("enabled"):
|
||||
self._draw_model(layout, model, running)
|
||||
layout.separator(type="LINE")
|
||||
ben2 = next(
|
||||
(model for model in models if model.get("key") == BEN2_MODEL_KEY),
|
||||
None,
|
||||
)
|
||||
if ben2:
|
||||
self._draw_model(layout, ben2, running)
|
||||
|
||||
def _draw_model(self, layout, model, running):
|
||||
row = layout.row(align=True)
|
||||
row.label(text=model["label"])
|
||||
if model.get("ready"):
|
||||
row.label(text="Ready", icon="CHECKMARK")
|
||||
else:
|
||||
download_row = row.row(align=True)
|
||||
download_row.enabled = runtime.environment_ready() and not running
|
||||
operator = download_row.operator(
|
||||
"anyimage.download_model",
|
||||
text="Download",
|
||||
icon="IMPORT",
|
||||
)
|
||||
operator.model = model["key"]
|
||||
|
||||
|
||||
class DebugPanel(bpy.types.Panel):
|
||||
bl_label = "Debug"
|
||||
bl_idname = "ANYIMAGE_PT_debug"
|
||||
|
||||
Reference in New Issue
Block a user