Refactor depth-related tests and improve parameter handling in image cutout symmetry

This commit is contained in:
2026-09-17 00:12:57 +08:00
parent 78bbff6351
commit c681d51fd1
20 changed files with 291 additions and 239 deletions

View File

@@ -97,12 +97,14 @@ def pinned_smooth(
iterations,
region,
weight=1.0,
movement=None,
pin_boundary=True,
pin_sharp=True,
):
"""Smooth positions toward a pinned target inside an influence region.
``weight`` is the smoothing weight: each point moves that share of the way
to the target every iteration, scaled further by the sharpness of the
normal field and the influence region.
``pin_boundary`` sends boundary points to a boundary-only blur so an outline
is never dragged inward. ``pin_sharp`` lowers the weight of creases through
the sharpness of the normal field. Junction bands keep the sharpness weight
@@ -158,12 +160,6 @@ def pinned_smooth(
offset.operation = "SCALE"
links.new(difference.outputs[0], offset.inputs[0])
links.new(weight, offset.inputs[3])
if movement is not None:
masked = nodes.new("ShaderNodeVectorMath")
masked.operation = "MULTIPLY"
links.new(offset.outputs[0], masked.inputs[0])
masked.inputs[1].default_value = movement
offset = masked
set_position = nodes.new("GeometryNodeSetPosition")
links.new(current, set_position.inputs["Geometry"])
links.new(offset.outputs[0], set_position.inputs["Offset"])