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

@@ -49,7 +49,7 @@ def evaluated(obj):
result.to_mesh_clear()
@pytest.mark.parametrize("subdivide", [0, 2, 4])
@pytest.mark.parametrize("subdivide", [0, 4])
def test_quad_sphere_topology_and_radial_endpoints(subdivide):
obj, set_value = panorama(subdivide=subdivide)
inputs = [s for s in obj.modifiers[0].node_group.interface.items_tree if s.item_type == "SOCKET" and s.in_out == "INPUT"]
@@ -124,7 +124,7 @@ def test_invalid_distance_removes_faces_between_valid_and_invalid_regions(sky_al
np.testing.assert_allclose(np.linalg.norm(evaluated(obj)[0], axis=1), 1, atol=1e-5)
def test_controls_smoothing_and_material_slot_inheritance():
def test_controls_and_material_slot_inheritance():
obj, set_value = panorama()
group = obj.modifiers[0].node_group
inputs = {s.name: s for s in group.interface.items_tree if s.item_type == "SOCKET" and s.in_out == "INPUT"}
@@ -138,15 +138,6 @@ def test_controls_smoothing_and_material_slot_inheritance():
obj.data.from_pydata([(0, 0, 0)], [], [])
material = bpy.data.materials.new("Slot Material")
obj.data.materials.append(material)
set_value("Smooth", 0)
original = evaluated(obj)
set_value("Smooth", 2)
smoothed = evaluated(obj)
assert smoothed[1] == original[1]
assert np.max(abs(smoothed[0] - original[0])) > 1e-4
np.testing.assert_array_equal(smoothed[2], original[2])
set_value("Smooth Weight", 0)
np.testing.assert_allclose(evaluated(obj)[0], original[0], atol=1e-6)
for name in ("First Slot", "Replacement Slot"):
current = bpy.data.materials.new(name)
obj.data.materials[0] = current