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:
@@ -129,6 +129,7 @@ class CutoutOperatorsTest(BlenderTestCase):
|
||||
alpha_threshold=0.25,
|
||||
fine_outline=False,
|
||||
color_image="Color",
|
||||
boundary_padding=2.0,
|
||||
gesture="POLYLINE",
|
||||
report=operator.report,
|
||||
)
|
||||
@@ -312,22 +313,6 @@ class CutoutOperatorsTest(BlenderTestCase):
|
||||
self.assertEqual(parameters["normal_mode"], "OBJECT")
|
||||
|
||||
|
||||
def test_cutout_geometry_settings_use_configured_moge(self):
|
||||
preferences = SimpleNamespace(
|
||||
geometry_model="MOGE2_VITB_NORMAL",
|
||||
geometry_resolution_level=7,
|
||||
)
|
||||
with patch.object(self.cutout_main, "addon_preferences", return_value=preferences), patch.object(
|
||||
self.anyimage.preferences, "addon_preferences", return_value=preferences
|
||||
):
|
||||
settings = self.cutout_main.cutout_geometry_settings(None)
|
||||
|
||||
self.assertEqual(
|
||||
settings,
|
||||
("MOGE2_VITB_NORMAL", 7),
|
||||
)
|
||||
|
||||
|
||||
def test_cutout_tool_settings_gate_normal_generation(self):
|
||||
class Row:
|
||||
def __init__(self, events):
|
||||
@@ -409,6 +394,7 @@ class CutoutOperatorsTest(BlenderTestCase):
|
||||
operator.edge_length = 0.1
|
||||
operator.generate_normal = True
|
||||
operator._selection_mask = selection_mask
|
||||
operator.boundary_padding = 3.5
|
||||
result = SimpleNamespace(value={}, file=lambda _key: Path(__file__))
|
||||
|
||||
with (
|
||||
@@ -446,3 +432,4 @@ class CutoutOperatorsTest(BlenderTestCase):
|
||||
self.assertIs(create_shape.call_args.kwargs["color_image"], color_image)
|
||||
self.assertEqual(create_shape.call_args.kwargs["alpha_threshold"], 0.25)
|
||||
self.assertIs(create_shape.call_args.kwargs["fine_outline"], False)
|
||||
self.assertEqual(create_shape.call_args.kwargs["boundary_padding"], 3.5)
|
||||
|
||||
Reference in New Issue
Block a user