Files
AnyImage/tests/tools/nodes/test_saved_layout.py
nan 489003c2cc Add new tests and functionality for image processing and geometry handling
- Introduced color_image.py for preparing standalone color images for tests.
- Added hdr_image.py to create HDR textures for testing.
- Implemented test_image_depth_panorama.py to evaluate panorama topology, UVs, and depth discontinuities.
- Created test_shadeless.py to validate the opacity and HDR color endpoints of the Shadeless group.
- Developed moge3_export.py for exporting dynamic MoGe-3 backbone and ONNX graphs.
- Added material.py to inherit material slots onto generated geometry.
- Built image_depth_panorama.py to construct a quad panorama with depth separation and sampling.
2026-09-10 14:42:17 +08:00

38 lines
1.3 KiB
Python

from tests.support.paths import PROJECT_ROOT
import unittest
SOURCE_ROOT = PROJECT_ROOT / "src" / "anyimage"
class NodeAssetsTest(unittest.TestCase):
def test_geometry_assets_preserve_node_structure(self):
import bpy
from tests.support.nodes import validate_node_structure
from tools.nodes.arrangement.arrange import arrange_nodes
bpy.ops.wm.read_factory_settings(use_empty=True)
with bpy.data.libraries.load(
str(SOURCE_ROOT / "assets" / "O_AnyImage.blend")
) as (source, target):
target.node_groups = list(source.node_groups)
groups = [
group
for group in target.node_groups
if group.bl_idname == "GeometryNodeTree"
]
self.assertEqual(len(groups), 7)
for group in groups:
validate_node_structure(group)
positions = {node.name: tuple(node.location) for node in group.nodes
if node.bl_idname not in {"NodeReroute", "NodeGroupInput"}}
arrange_nodes(group)
for name, position in positions.items():
for actual, expected in zip(group.nodes[name].location, position):
self.assertAlmostEqual(actual, expected, delta=0.01, msg=f"{group.name}: {name}")
if __name__ == "__main__":
unittest.main()