Add comprehensive tests for edge depth extension, empty image edits, and material view adaptation

- Introduced `test_edge_depth.py` to validate the functionality of edge depth extension, ensuring core alpha preservation, proper depth handling, and edge padding behavior.
- Created `test_empty_image_edits.py` to verify the behavior of image edits in Blender, focusing on shared edits, preservation of image properties, and handling of failed operations.
- Developed `test_material_view_adaptation.py` to test material adaptation preferences, ensuring color space and alpha settings are correctly applied and preserved across various scenarios.
This commit is contained in:
2026-09-06 21:43:47 +08:00
parent 1994d38ccd
commit 7e55af6722
58 changed files with 3607 additions and 200 deletions

View File

@@ -17,6 +17,7 @@ from ...common.object import (
)
from ...common.node import load_node_group
from .geometry import (
CUTOUT_ALPHA_THRESHOLD,
DEFAULT_DEPTH_BASELINE,
DEFAULT_DEPTH_DIRECTION,
crop_plane_bounds,
@@ -161,6 +162,7 @@ def create_shape_object(
content_bounds,
base_shape,
*,
alpha_threshold=CUTOUT_ALPHA_THRESHOLD,
depth_image=None,
depth_metadata=None,
normal_image=None,
@@ -213,7 +215,7 @@ def create_shape_object(
raise ValueError("Depth Shape requires a Depth texture and metadata")
camera_depth, valid = camera_depth_values(depth_image)
calibration_valid, transparent_fraction = selection_calibration(
content_values, valid.shape
content_values, valid.shape, threshold=alpha_threshold
)
calibration_valid &= valid
uniform_scale = depth_uniform_scale(