feat(node_assets): add image plane geometry nodes and validation scripts
- Implemented `image_plane.py` to build the Image Plane Geometry Nodes group with customizable parameters for geometry, subdivide, and thickness. - Created `image_plane_validation.py` to validate the functionality of the image plane, ensuring correct geometry generation and material assignment. - Developed `material_layers.py` to construct shader node groups for image materials, including depth and normal handling. - Authored `plane_layouts.py` to define node arrangements for image geometry assets. - Introduced `shadeless.py` to create a shadeless shader node group that displays color without scene lighting while preserving shadows and reflections.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Contracts for smooth depth volume, editable presets and normal masks."""
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import bpy
|
||||
import numpy as np
|
||||
import pytest
|
||||
@@ -9,7 +8,7 @@ import pytest
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "src"))
|
||||
sys.path.insert(0, str(ROOT / "tools/node_assets"))
|
||||
from build_cutout_modifiers import build_cutout_group
|
||||
from cutout import build_cutout_group
|
||||
from cutout_volume import build_volume_fields
|
||||
from cutout_rounding import build_volume_rounding
|
||||
from anyimage.operators.cutout_tool.object import load_cutout_node_group
|
||||
@@ -66,7 +65,7 @@ def test_depth_rounding_options_are_consolidated():
|
||||
@pytest.mark.parametrize("iterations", [0, 50])
|
||||
def test_uniform_thickness_follows_the_tilted_front_normal(iterations):
|
||||
from scipy.spatial import cKDTree
|
||||
from test_depth_surface_nodes import surface, evaluated, assert_closed
|
||||
from depth_surface_test_support import surface, evaluated, assert_closed
|
||||
obj, set_value = surface(step=0, resolution=4)
|
||||
image = bpy.data.images["Camera"]
|
||||
pixels = np.array(image.pixels[:], dtype=np.float32).reshape(32, 64, 4)
|
||||
@@ -85,7 +84,7 @@ def test_uniform_thickness_follows_the_tilted_front_normal(iterations):
|
||||
|
||||
def test_balloon_shell_converges_to_front_with_thickness():
|
||||
from scipy.spatial import cKDTree
|
||||
from test_depth_surface_nodes import surface, evaluated, assert_closed
|
||||
from depth_surface_test_support import surface, evaluated, assert_closed
|
||||
obj, set_value = surface(step=1, resolution=10)
|
||||
xy = np.array([v.co[:2] for v in obj.data.vertices])
|
||||
profile = 0.3 * np.sin(np.pi * xy[:, 0] / 2) * np.sin(np.pi * xy[:, 1])
|
||||
@@ -198,7 +197,7 @@ def test_smooth_back_rejects_front_noise_and_preserves_center_depth():
|
||||
|
||||
|
||||
def test_depth_cutout_normal_map_only_affects_front_faces():
|
||||
from test_depth_surface_nodes import surface
|
||||
from depth_surface_test_support import surface
|
||||
obj, set_value = surface()
|
||||
set_value("Thickness", 0.3)
|
||||
bpy.context.view_layer.update()
|
||||
@@ -217,7 +216,7 @@ def test_depth_cutout_normal_map_only_affects_front_faces():
|
||||
@pytest.mark.parametrize("structure", [0, 1, 4])
|
||||
@pytest.mark.parametrize("thickness", [0.0, 0.02, 0.1])
|
||||
def test_uniform_front_inflation_scales_with_distance(thickness, structure):
|
||||
from test_depth_surface_nodes import surface, evaluated, assert_closed
|
||||
from depth_surface_test_support import surface, evaluated, assert_closed
|
||||
obj, set_value = surface(step=0, resolution=10)
|
||||
xy = np.array([v.co[:2] for v in obj.data.vertices])
|
||||
profile = 0.3 * np.sin(np.pi * xy[:, 0] / 2) * np.sin(np.pi * xy[:, 1])
|
||||
@@ -245,7 +244,7 @@ def test_uniform_front_inflation_scales_with_distance(thickness, structure):
|
||||
|
||||
|
||||
def test_normal_smooth_controls_front_and_rear_directions():
|
||||
from test_depth_surface_nodes import surface, evaluated
|
||||
from depth_surface_test_support import surface, evaluated
|
||||
obj, set_value = surface(step=1, resolution=10)
|
||||
set_value("Front Inflation", 1.0)
|
||||
xy = np.array([v.co[:2] for v in obj.data.vertices])
|
||||
@@ -274,7 +273,7 @@ def test_normal_smooth_controls_front_and_rear_directions():
|
||||
|
||||
|
||||
def test_balloon_suppression_is_stronger_without_a_startup_threshold():
|
||||
from test_depth_surface_nodes import surface, evaluated
|
||||
from depth_surface_test_support import surface, evaluated
|
||||
obj, set_value = surface(step=0, resolution=10)
|
||||
xy = np.array([v.co[:2] for v in obj.data.vertices])
|
||||
profile = 0.3 * np.sin(np.pi * xy[:, 0] / 2) * np.sin(np.pi * xy[:, 1])
|
||||
|
||||
Reference in New Issue
Block a user