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 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -70,3 +69,24 @@ def test_blender_path_reports_missing_configuration(tmp_path):
|
||||
):
|
||||
with pytest.raises(RuntimeError, match="Blender not found"):
|
||||
launcher.blender_path()
|
||||
|
||||
|
||||
def test_launcher_runs_asset_build_and_validations_before_tests(monkeypatch, tmp_path):
|
||||
launcher = load_launcher()
|
||||
executable = tmp_path / "blender"
|
||||
executable.touch()
|
||||
calls = []
|
||||
monkeypatch.setattr(launcher, "blender_path", lambda _: executable)
|
||||
monkeypatch.setattr(launcher, "run", calls.append)
|
||||
monkeypatch.setattr("sys.argv", ["build_node"])
|
||||
|
||||
launcher.main()
|
||||
|
||||
scripts = [Path(command[-1]) for command in calls[:-1]]
|
||||
assert [path.name for path in scripts] == [
|
||||
"asset_library.py", "asset_validation.py",
|
||||
"image_plane_validation.py", "cutout_validation.py",
|
||||
]
|
||||
assert all(path.is_file() for path in scripts)
|
||||
assert all(command[1:4] == ("--factory-startup", "--background", "--python") for command in calls[:-1])
|
||||
assert calls[-1][1:] == ("-m", "pytest")
|
||||
|
||||
Reference in New Issue
Block a user