Refactor depth surface and image cutout nodes for improved functionality and clarity

- Removed deprecated tests and code related to shell wall connections and coincident sheets.
- Updated attribute handling in depth surface and image cutout groups, including new vector attribute functions.
- Enhanced the inflation logic in the image depth cutout group to better manage shell and balloon behaviors.
- Improved parameter naming and descriptions for clarity in the user interface.
- Streamlined the geometry processing logic to ensure better performance and maintainability.
This commit is contained in:
2026-09-17 17:11:31 +08:00
parent 0aeb61f818
commit 2811c7bf3a
10 changed files with 217 additions and 556 deletions

View File

@@ -138,6 +138,13 @@ def read_float_attribute(group, name):
return node.outputs["Attribute"]
def read_vector_attribute(group, name):
node = group.nodes.new("GeometryNodeInputNamedAttribute")
node.data_type = "FLOAT_VECTOR"
node.inputs["Name"].default_value = name
return node.outputs["Attribute"]
def store_float_attribute(group, geometry, name, value, domain="POINT"):
node = group.nodes.new("GeometryNodeStoreNamedAttribute")
node.domain, node.data_type = domain, "FLOAT"
@@ -150,6 +157,15 @@ def store_float_attribute(group, geometry, name, value, domain="POINT"):
return node.outputs["Geometry"]
def store_vector_attribute(group, geometry, name, value, domain="POINT"):
node = group.nodes.new("GeometryNodeStoreNamedAttribute")
node.domain, node.data_type = domain, "FLOAT_VECTOR"
node.inputs["Name"].default_value = name
group.links.new(geometry, node.inputs["Geometry"])
group.links.new(value, node.inputs["Value"])
return node.outputs["Geometry"]
def evaluate_field(group, value, data_type, domain):
"""Evaluate a field on an explicit domain before downstream adaptation."""
node = group.nodes.new("GeometryNodeFieldOnDomain")
@@ -184,26 +200,12 @@ def store_boolean_attribute(group, geometry, name, value, domain="POINT"):
return node.outputs["Geometry"], read.outputs["Attribute"]
def remove_attributes(group, geometry, *names, enabled=None):
"""Remove only the explicitly owned temporary attributes."""
original = geometry
for name in names:
node = group.nodes.new("GeometryNodeRemoveAttribute")
node.inputs["Name"].default_value = name
group.links.new(geometry, node.inputs["Geometry"])
geometry = node.outputs["Geometry"]
if enabled is not None:
choose = group.nodes.new("GeometryNodeSwitch")
choose.input_type = "GEOMETRY"
group.links.new(enabled, choose.inputs["Switch"])
group.links.new(original, choose.inputs["False"])
group.links.new(geometry, choose.inputs["True"])
geometry = choose.outputs["Output"]
return geometry
def remove_attribute_pattern(group, geometry, pattern):
"""Remove every attribute matching an internal wildcard pattern."""
"""Remove every attribute matching an internal wildcard pattern.
Always clean internal attributes with a pattern: naming an attribute that a
branch never stored makes the Remove Named Attribute node warn.
"""
node = group.nodes.new("GeometryNodeRemoveAttribute")
node.inputs["Name"].default_value = pattern
node.pattern_mode = "WILDCARD"