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:
@@ -197,6 +197,9 @@ def test_relief_plane_builds_a_fixed_base_terrain_block():
|
||||
assert result.modifiers[0].node_group.name == "O Image Relief Plane"
|
||||
modifier = result.modifiers[0]
|
||||
group = modifier.node_group
|
||||
for name in ("Thickness", "Depth Scale"):
|
||||
identifier = object_data.modifier_input_identifier(group, name)
|
||||
assert modifier[identifier] == 0.5
|
||||
|
||||
def set_input(name, value):
|
||||
object_data.set_modifier_input(
|
||||
@@ -262,3 +265,5 @@ def test_relief_plane_builds_a_fixed_base_terrain_block():
|
||||
set_input("Reference Depth", 1.2)
|
||||
sheet = _evaluated_positions(result)
|
||||
assert np.allclose(sheet[:, 2], 0.2, atol=1e-5)
|
||||
set_input("Reference Depth", 0.8)
|
||||
assert np.allclose(_evaluated_positions(result)[:, 2], 0.0, atol=1e-5)
|
||||
|
||||
Reference in New Issue
Block a user