Refactor geometry node groups for image depth processing
- Introduced new utility functions in common nodes for evaluating fields and capturing attributes. - Simplified volume field calculations in image depth cutout and panorama groups by utilizing new utility functions. - Enhanced readability and maintainability of the image depth cutout and panorama node groups by removing redundant code and improving function usage. - Adjusted default values for thickness and depth scale in image relief plane group for better user experience. - Improved handling of geometry attributes and connections in image depth plane group to streamline processing.
This commit is contained in:
@@ -31,12 +31,12 @@ def build_image_relief_plane_group(image_plane_group):
|
||||
subdivide.min_value = 0
|
||||
subdivide.max_value = 10
|
||||
thickness = _interface_socket(group, "Thickness", "INPUT", "NodeSocketFloat")
|
||||
thickness.default_value = 0.0
|
||||
thickness.default_value = 0.5
|
||||
thickness.min_value = 0.0
|
||||
thickness.subtype = "DISTANCE"
|
||||
thickness.description = "Fixed relief base thickness"
|
||||
depth_scale = _interface_socket(group, "Depth Scale", "INPUT", "NodeSocketFloat")
|
||||
depth_scale.default_value = 1.0
|
||||
depth_scale.default_value = 0.5
|
||||
depth_scale.min_value = 0.0
|
||||
options = group.interface.new_panel(name="Options", default_closed=True)
|
||||
base_plane_depth = _interface_socket(
|
||||
@@ -129,10 +129,13 @@ def build_image_relief_plane_group(image_plane_group):
|
||||
has_thickness = _math(nodes, "GREATER_THAN")
|
||||
has_thickness.inputs[1].default_value = 1e-6
|
||||
links.new(shape_input.outputs["Thickness"], has_thickness.inputs[0])
|
||||
flat_offset = _math(nodes, "MAXIMUM")
|
||||
flat_offset.inputs[1].default_value = 0.0
|
||||
links.new(full_offset.outputs[0], flat_offset.inputs[0])
|
||||
safe_offset = nodes.new("GeometryNodeSwitch")
|
||||
safe_offset.input_type = "FLOAT"
|
||||
links.new(has_thickness.outputs[0], safe_offset.inputs["Switch"])
|
||||
links.new(full_offset.outputs[0], safe_offset.inputs["False"])
|
||||
links.new(flat_offset.outputs[0], safe_offset.inputs["False"])
|
||||
links.new(limited_offset.outputs[0], safe_offset.inputs["True"])
|
||||
|
||||
position = nodes.new("GeometryNodeInputPosition")
|
||||
|
||||
Reference in New Issue
Block a user