Files
AnyImage/tests/tools/nodes/test_inventory.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

24 lines
1.2 KiB
Python

"""Check the saved library's public inventory and persistence."""
import bpy
from anyimage.common.node import load_node_group, node_asset_path
from tools.nodes.check import GEOMETRY_NAMES, SHADER_NAMES
def test_saved_asset_inventory():
bpy.ops.wm.read_factory_settings(use_empty=True)
with bpy.data.libraries.load(str(node_asset_path())) as (source, _):
assert set(source.node_groups) == GEOMETRY_NAMES | SHADER_NAMES
for name in sorted(GEOMETRY_NAMES | SHADER_NAMES):
bpy.ops.wm.read_factory_settings(use_empty=True)
node_group = load_node_group(name)
assert node_group.bl_idname == ("GeometryNodeTree" if name in GEOMETRY_NAMES else "ShaderNodeTree")
assert node_group.use_fake_user and node_group.users > 0
if name in GEOMETRY_NAMES:
assert node_group.is_modifier
if bpy.app.version >= (5, 0, 0):
assert node_group.library is not None
if name in {"O Image Depth Layer", "O Shadeless"}:
expected = ["Color", "Alpha", "Depth", "Bump Scale"] if name == "O Image Depth Layer" else ["Color", "Alpha"]
assert [item.name for item in node_group.interface.items_tree
if item.item_type == "SOCKET" and item.in_out == "INPUT"] == expected