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:
@@ -104,7 +104,43 @@ def model_ready(model_key):
|
||||
|
||||
|
||||
def required_models_ready():
|
||||
return all(model_ready(model_key) for model_key in REQUIRED_MODEL_KEYS)
|
||||
return not ai_status()["missing_models"]
|
||||
|
||||
|
||||
def ai_status():
|
||||
environment_ready = runtime.environment_ready()
|
||||
ready_models = {
|
||||
model["key"] for model in model_catalog() if model.get("ready")
|
||||
}
|
||||
missing_models = tuple(
|
||||
model_key
|
||||
for model_key in REQUIRED_MODEL_KEYS
|
||||
if model_key not in ready_models
|
||||
)
|
||||
return {
|
||||
"environment_ready": environment_ready,
|
||||
"missing_models": missing_models,
|
||||
"ready": environment_ready and not missing_models,
|
||||
}
|
||||
|
||||
|
||||
def ai_ready():
|
||||
return ai_status()["ready"]
|
||||
|
||||
|
||||
def ai_setup_label(status=None):
|
||||
if status is None:
|
||||
status = ai_status()
|
||||
return (
|
||||
"Download Required Models…"
|
||||
if status["environment_ready"]
|
||||
else "Set Up AI Environment…"
|
||||
)
|
||||
|
||||
|
||||
def model_download_size(model_key):
|
||||
model = shared_model_catalog.get_downloadable_model(model_key)
|
||||
return sum(size for _path, size, _checksum in model.r2_files)
|
||||
|
||||
|
||||
def model_catalog():
|
||||
@@ -244,6 +280,35 @@ def balloon_contour_analysis_property():
|
||||
)
|
||||
|
||||
|
||||
def image_lasso_contour_analysis_property():
|
||||
return bpy.props.BoolProperty(
|
||||
name="Contour",
|
||||
description=(
|
||||
"Use BEN2 to refine the lasso Alpha while preserving the source colors"
|
||||
),
|
||||
default=False,
|
||||
)
|
||||
|
||||
|
||||
def image_lasso_keep_original_property():
|
||||
return bpy.props.BoolProperty(
|
||||
name="Keep Original",
|
||||
description="Keep the source Image Empty and create a cropped copy",
|
||||
default=False,
|
||||
)
|
||||
|
||||
|
||||
def image_lasso_padding_property():
|
||||
return bpy.props.IntProperty(
|
||||
name="Padding",
|
||||
description="Transparent padding in pixels around the visible Alpha bounds",
|
||||
default=0,
|
||||
min=0,
|
||||
soft_max=256,
|
||||
subtype="PIXEL",
|
||||
)
|
||||
|
||||
|
||||
def balloon_depth_analysis_property():
|
||||
return bpy.props.BoolProperty(
|
||||
name="Depth",
|
||||
@@ -270,6 +335,9 @@ def balloon_radial_zoom_property(scale):
|
||||
|
||||
|
||||
class AnyImageSettings(bpy.types.PropertyGroup):
|
||||
image_lasso_contour_analysis: image_lasso_contour_analysis_property()
|
||||
image_lasso_keep_original: image_lasso_keep_original_property()
|
||||
image_lasso_padding: image_lasso_padding_property()
|
||||
balloon_mode: balloon_mode_property()
|
||||
balloon_thickness: balloon_thickness_property()
|
||||
balloon_resolution: balloon_resolution_property()
|
||||
|
||||
Reference in New Issue
Block a user