- Implemented the "O Image Relief Plane" Geometry Nodes group to create a fixed-base image relief using depth images and various parameters. - Created the "O Shadeless" shader node group to display color without scene lighting while preserving shadows and reflections. - Introduced a preview feature for node groups, allowing for interactive visualization of node arrangements in an HTML format. - Added a template HTML file for rendering node previews with customizable views and controls.
23 lines
1.2 KiB
Python
23 lines
1.2 KiB
Python
"""Shared assertions and asset selection for node tests."""
|
|
from tools.nodes.groups.image_cutout import build_image_cutout_group
|
|
from tools.nodes.groups.image_depth_cutout import build_image_depth_cutout_group
|
|
from tools.nodes.groups.image_depth_balloon import build_image_depth_balloon_group
|
|
|
|
CUTOUT_BUILDERS = {
|
|
"FLAT": build_image_cutout_group,
|
|
"SOLID": build_image_cutout_group,
|
|
"DEPTH_SOLID": build_image_depth_cutout_group,
|
|
"DEPTH_BALLOON": build_image_depth_balloon_group,
|
|
}
|
|
|
|
|
|
def validate_node_structure(node_group):
|
|
"""Check visible sockets, default titles, and paired execution endpoints."""
|
|
nodes = [node for node in node_group.nodes if node.bl_idname not in {"NodeReroute", "NodeFrame"}]
|
|
assert all(not node.label for node in nodes), node_group.name
|
|
assert not any(node.bl_idname == "FunctionNodeInputString" for node in nodes), node_group.name
|
|
assert all(socket.is_linked or socket.hide for node in node_group.nodes for socket in node.outputs), node_group.name
|
|
for node in nodes:
|
|
if node.bl_idname in {"GeometryNodeRepeatInput", "GeometryNodeSimulationInput", "GeometryNodeForeachGeometryElementInput"}:
|
|
assert node.paired_output in node_group.nodes.values(), (node_group.name, node.name)
|