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:
@@ -6,6 +6,7 @@ import unittest
|
||||
from pathlib import Path
|
||||
from types import ModuleType, SimpleNamespace
|
||||
from unittest.mock import Mock, patch
|
||||
from blender_test_support import mock_bpy_imports
|
||||
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
@@ -15,6 +16,10 @@ sys.path.insert(0, str(PROJECT_ROOT / "src"))
|
||||
class ClipboardImageTest(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.previous_addon_modules = {
|
||||
name: module for name, module in sys.modules.items()
|
||||
if name == "anyimage" or name.startswith("anyimage.")
|
||||
}
|
||||
cls.temporary_directory = tempfile.TemporaryDirectory()
|
||||
cls.remove_anyimage_modules()
|
||||
fake_bpy = ModuleType("bpy")
|
||||
@@ -47,7 +52,9 @@ class ClipboardImageTest(unittest.TestCase):
|
||||
)
|
||||
)
|
||||
fake_bpy.data = SimpleNamespace()
|
||||
sys.modules["bpy"] = fake_bpy
|
||||
cls.bpy_import_patch = mock_bpy_imports(fake_bpy)
|
||||
cls.bpy_import_patch.start()
|
||||
cls.addClassCleanup(cls.bpy_import_patch.stop)
|
||||
cls.fake_bpy = fake_bpy
|
||||
|
||||
cls.addon = ModuleType("anyimage")
|
||||
@@ -64,9 +71,9 @@ class ClipboardImageTest(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
sys.modules.pop("bpy", None)
|
||||
cls.remove_anyimage_modules()
|
||||
cls.temporary_directory.cleanup()
|
||||
sys.modules.update(cls.previous_addon_modules)
|
||||
|
||||
def test_operators_use_anyimage_prefix_and_plain_properties(self):
|
||||
clipboard_image = self.addon.clipboard_image
|
||||
|
||||
Reference in New Issue
Block a user