Refactor geometry generation to standardize Blender object coordinates
- Unified the canonical local frame for generated geometries (Plane, Depth Plane, Relief Plane, Cutout, Depth Cutout) to align with Blender's object coordinate system, setting X as horizontal, Z as up, and +Y as depth. - Removed the `Depth Axis` parameter from `O Image Cutout` and `O Image Depth Cutout`, simplifying the geometry generation process. - Updated the depth direction defaults to use +Y instead of -Z for `O Image Relief Plane` and Depth Symmetry. - Adjusted the geometry nodes to ensure thickness, projection, and shell displacements operate along the Y-axis. - Implemented new capabilities for handling object space normals to align with the new canonical frame. - Enhanced the Depth Symmetry functionality to mirror across the canonical Y-axis and perform a final rotation to maintain the correct orientation. - Added tests to validate the new coordinate system and ensure compatibility with existing assets.
This commit is contained in:
@@ -99,7 +99,7 @@ def test_saved_image_plane_evaluation():
|
||||
(0.5, 1.0),
|
||||
(1.0, 1.0),
|
||||
}
|
||||
assert all(abs(vertex.co.z) < 1e-6 for vertex in result.vertices)
|
||||
assert all(abs(vertex.co.y) < 1e-6 for vertex in result.vertices)
|
||||
assert all(polygon.material_index == 0 for polygon in result.polygons)
|
||||
finally:
|
||||
evaluated.to_mesh_clear()
|
||||
@@ -120,10 +120,10 @@ def test_saved_image_plane_evaluation():
|
||||
try:
|
||||
assert result.materials[0].original == material
|
||||
assert len(result.polygons) == 184
|
||||
z_values = [vertex.co.z for vertex in result.vertices]
|
||||
assert abs(min(z_values) + 0.6) < 1e-6
|
||||
assert abs(max(z_values) - 0.6) < 1e-6
|
||||
assert len({round(value, 6) for value in z_values}) == 6
|
||||
y_values = [vertex.co.y for vertex in result.vertices]
|
||||
assert abs(min(y_values) + 0.6) < 1e-6
|
||||
assert abs(max(y_values) - 0.6) < 1e-6
|
||||
assert len({round(value, 6) for value in y_values}) == 6
|
||||
edge_users = {edge.key: 0 for edge in result.edges}
|
||||
for polygon in result.polygons:
|
||||
for edge_key in polygon.edge_keys:
|
||||
@@ -138,8 +138,8 @@ def test_saved_image_plane_evaluation():
|
||||
obj.update_tag(refresh={"DATA"})
|
||||
evaluated, result = evaluated_mesh(obj)
|
||||
try:
|
||||
z_values = {round(vertex.co.z, 6) for vertex in result.vertices}
|
||||
assert len(z_values) >= 4
|
||||
y_values = {round(vertex.co.y, 6) for vertex in result.vertices}
|
||||
assert len(y_values) >= 4
|
||||
finally:
|
||||
evaluated.to_mesh_clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user