Add comprehensive tests for cutout and mesh functionalities
- Introduced `test_cutout.py` to validate cutout pie menu behavior, image lasso options, and mesh detail calculations. - Added `test_mesh.py` to ensure correct tangent normal rasterization, plane source topology, and depth surface evaluations. - Created `test_mesh_blender.py` to verify material node groups, tangent baking, and local cutout building from Blender images. - Implemented tests for handling alpha regions and ensuring geometry nodes maintain expected behavior.
This commit is contained in:
@@ -14,7 +14,6 @@ from .preferences import (
|
||||
from .runtime import runtime
|
||||
from .server import model_catalog as shared_model_catalog
|
||||
|
||||
|
||||
BEN2_MODEL_KEY = "BEN2_BASE"
|
||||
REALESRGAN_GENERAL_WDN_MODEL_KEY = shared_model_catalog.DEFAULT_UPSCALE_MODEL_KEY
|
||||
SAFMN_MODEL_KEY = shared_model_catalog.SAFMN_MODEL.key
|
||||
@@ -121,13 +120,9 @@ def required_models_ready():
|
||||
|
||||
def ai_status():
|
||||
environment_ready = runtime.environment_ready()
|
||||
ready_models = {
|
||||
model["key"] for model in model_catalog() if model.get("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
|
||||
model_key for model_key in REQUIRED_MODEL_KEYS if model_key not in ready_models
|
||||
)
|
||||
return {
|
||||
"environment_ready": environment_ready,
|
||||
@@ -201,6 +196,7 @@ def balloon_depth_model_enum_items(_owner, _context):
|
||||
models.sort(key=lambda model: model.get("key") != DEFAULT_MOGE2_MODEL_KEY)
|
||||
return _model_items(models)
|
||||
|
||||
|
||||
def depth_plane_model_enum_items(_owner, _context):
|
||||
models = [
|
||||
model
|
||||
@@ -329,6 +325,26 @@ def image_edit_refine_selection_property():
|
||||
)
|
||||
|
||||
|
||||
def cutout_normal_analysis_property():
|
||||
return bpy.props.BoolProperty(
|
||||
name="Normal",
|
||||
description="Use MoGe-2 to add a normal texture for the selected shape",
|
||||
default=False,
|
||||
)
|
||||
|
||||
def cutout_pixel_size_property():
|
||||
return bpy.props.IntProperty(
|
||||
name="Pixel Size",
|
||||
description=(
|
||||
"Approximate source image pixels per mesh step; smaller values "
|
||||
"create denser geometry"
|
||||
),
|
||||
default=32,
|
||||
min=4,
|
||||
max=32,
|
||||
)
|
||||
|
||||
|
||||
def balloon_depth_analysis_property():
|
||||
return bpy.props.BoolProperty(
|
||||
name="Depth",
|
||||
@@ -345,6 +361,7 @@ def balloon_depth_model_property():
|
||||
default=0,
|
||||
)
|
||||
|
||||
|
||||
def balloon_radial_zoom_property(scale):
|
||||
return bpy.props.FloatVectorProperty(
|
||||
size=2,
|
||||
@@ -355,6 +372,8 @@ def balloon_radial_zoom_property(scale):
|
||||
|
||||
|
||||
class AnyImageSettings(bpy.types.PropertyGroup):
|
||||
cutout_pixel_size: cutout_pixel_size_property()
|
||||
cutout_normal_analysis: cutout_normal_analysis_property()
|
||||
image_edit_refine_selection: image_edit_refine_selection_property()
|
||||
balloon_mode: balloon_mode_property()
|
||||
balloon_thickness: balloon_thickness_property()
|
||||
|
||||
Reference in New Issue
Block a user