feat(cutout): implement boundary padding for cutout textures

- Introduced a new `Boundary Padding` preference in the Cutout Tool with a default of 2 px and a configurable range of 1-4 px.
- Updated the Cutout client to establish inward mapping from the final Mask, sampling in a fixed direction and processing independent material RGBA and Depth.
- Enhanced the handling of RGBA and Depth during cutout operations, ensuring proper mapping and preservation of source data.
- Added tests to validate the new boundary padding functionality and its integration with existing cutout processes.

feat(geometry): remove overall mesh smoothing from geometry nodes

- Removed the `Smooth` input from several geometry node groups to eliminate unnecessary overall mesh smoothing.
- Retained `Smooth Weight` for depth nodes while removing it from Cutout and Relief Plane nodes.
- Ensured that boundary, normal, and fill smoothing behaviors remain intact and consistent.
- Updated tests and documentation to reflect the changes in node interfaces and behaviors.

feat(normals): scale tangent normals with depth

- Reused the existing `o_normal_reduction` attribute to adjust Tangent Normal strength based on the geometry's `Depth Scale`.
- Ensured that Tangent Normal strength is consistent with the geometry depth, preserving full strength for materials that do not provide the attribute.
- Updated tests to verify the correct behavior of normal strength adjustments in both Tangent and Object Space.
This commit is contained in:
2026-09-15 00:40:24 +08:00
parent ab282e4fdf
commit 591e62085a
93 changed files with 1915 additions and 2851 deletions

View File

@@ -69,8 +69,11 @@ def run_conversion(source, entry, monkeypatch):
return bpy.context.object
@pytest.mark.parametrize("entry", ["PLANE", "DEPTH", "RELIEF"])
@pytest.mark.parametrize("sharing", ["none", "visible", "hidden", "other_scene", "material", "same_path"])
@pytest.mark.parametrize("entry,sharing", [
("PLANE", "none"),
("PLANE", "material"),
("DEPTH", "visible"),
])
def test_conversion_selects_source_by_empty_identity(source, monkeypatch, entry, sharing):
share_image(source, sharing)
original = source.data
@@ -92,9 +95,11 @@ def test_conversion_selects_source_by_empty_identity(source, monkeypatch, entry,
assert next(n.image for n in existing.node_tree.nodes if n.type == "TEX_IMAGE") == original
@pytest.mark.parametrize("shared", [False, True])
@pytest.mark.parametrize("failure", ["material", "modifier", "finalize"])
@pytest.mark.parametrize("entry", ["PLANE", "DEPTH", "RELIEF"])
@pytest.mark.parametrize("shared,failure,entry", [
(False, "material", "PLANE"),
(True, "modifier", "DEPTH"),
(False, "finalize", "PLANE"),
])
def test_conversion_failure_restores_image_and_releases_resources(source, monkeypatch, shared, failure, entry):
if shared:
share_image(source, "visible")
@@ -124,8 +129,7 @@ def test_conversion_failure_restores_image_and_releases_resources(source, monkey
np.testing.assert_array_equal(original.pixels[:], state["pixels"])
@pytest.mark.parametrize("shared", [False, True])
@pytest.mark.parametrize("kind", ["generated", "file", "dirty", "packed"])
@pytest.mark.parametrize("shared,kind", [(False, "generated"), (True, "file")])
def test_conversion_pixels_survive_library_reload(source, tmp_path, monkeypatch, kind, shared):
if kind in {"file", "dirty"}:
path = tmp_path / "source.png"