feat: Add new Geometry Nodes groups for image relief and shadeless shader

- 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.
This commit is contained in:
2026-09-09 21:24:57 +08:00
parent f5aff50b13
commit 89087fc2e2
118 changed files with 5635 additions and 3130 deletions

View File

@@ -68,7 +68,7 @@ def test_image_layer_switches_between_tangent_and_object_space_normal():
color = bpy.data.images.new("Color", width=2, height=2)
normal_image = bpy.data.images.new("Normal", width=2, height=2)
object_material = material_data.create_image_material(
SimpleNamespace(data=SimpleNamespace(name="Object Normal")),
SimpleNamespace(name="Object Normal"),
color,
1.0,
normal_image=normal_image,
@@ -78,7 +78,7 @@ def test_image_layer_switches_between_tangent_and_object_space_normal():
assert layer.inputs["Object Space"].default_value is True
tangent_material = material_data.create_image_material(
SimpleNamespace(data=SimpleNamespace(name="Tangent Normal")),
SimpleNamespace(name="Tangent Normal"),
color,
1.0,
normal_image=normal_image,
@@ -127,13 +127,15 @@ def test_plane_material_color_drives_ior_level_but_shadeless_does_not():
image = bpy.data.images.new("Plane", width=2, height=2, alpha=True)
source = SimpleNamespace(data=SimpleNamespace(name="Plane"))
material = material_data.create_image_material(source, image, 0.0)
material = material_data.create_image_material(source.data, image)
shader = next(
node
for node in material.node_tree.nodes
if node.bl_idname == "ShaderNodeBsdfPrincipled"
)
assert np.isclose(shader.inputs["IOR"].default_value, 1.2)
image_layer = _group_node(material_data.material_node_group(), material.node_tree)
assert image_layer.inputs["Bump Scale"].default_value == 0.0
assert any(
link.from_node == image_layer
and link.from_socket == image_layer.outputs["Color"]
@@ -143,7 +145,7 @@ def test_plane_material_color_drives_ior_level_but_shadeless_does_not():
)
shadeless = material_data.create_image_material(
source,
source.data,
image,
0.0,
shadeless=True,
@@ -163,7 +165,7 @@ def test_cutout_material_uses_flat_tangent_normal():
normal = bpy.data.images.new("Normal", width=1, height=1)
result = material_data.create_image_material(
source,
source.data,
color,
0.0,
normal_image=normal,