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

@@ -61,6 +61,12 @@ def configured_storage_root():
return DEFAULT_STORAGE_ROOT
def configured_material_view_adaptation(context=None):
return bool(
getattr(addon_preferences(context), "adapt_material_to_view_transform", True)
)
def configured_max_cutout_mesh_resolution(context=None):
preferences = addon_preferences(context)
value = int(
@@ -109,6 +115,14 @@ def geometry_model_items(owner, context):
class AnyImagePreferences(bpy.types.AddonPreferences):
bl_idname = ADDON_PACKAGE
adapt_material_to_view_transform: bpy.props.BoolProperty(
name="Adapt to Scene View Transform",
description=(
"Use the scene view transform's inverse color space with Straight alpha "
"for new material color textures; otherwise use sRGB with Premultiplied alpha"
),
default=True,
)
storage_root: bpy.props.StringProperty(
name="Storage Root",
description=(
@@ -243,6 +257,9 @@ class AnyImagePreferences(bpy.types.AddonPreferences):
"AI Upscale Image",
)
shading = self._draw_box(layout, "Shading")
shading.prop(self, "adapt_material_to_view_transform")
tools = self._draw_box(layout, "Tools")
tools.label(text="Frame Tool")
tools.prop(self, "max_frame_resolution")