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:
@@ -91,9 +91,9 @@ def material_node_group(depth_plane=False):
|
||||
|
||||
|
||||
def create_image_material(
|
||||
source_object,
|
||||
source_image,
|
||||
color_image,
|
||||
depth_scale,
|
||||
depth_scale=0.0,
|
||||
displacement_image=None,
|
||||
displacement_midlevel=0.0,
|
||||
displacement_scale=1.0,
|
||||
@@ -107,11 +107,10 @@ def create_image_material(
|
||||
use_cyclic=None,
|
||||
normal_image=None,
|
||||
normal_space="TANGENT",
|
||||
ior=None,
|
||||
scene=None,
|
||||
):
|
||||
material_image = configure_material_color_image(color_image, scene)
|
||||
material = bpy.data.materials.new(image_base_name(source_object.data))
|
||||
material = bpy.data.materials.new(image_base_name(source_image))
|
||||
material.use_nodes = True
|
||||
if hasattr(material, "surface_render_method"):
|
||||
material.surface_render_method = "DITHERED"
|
||||
@@ -155,6 +154,10 @@ def create_image_material(
|
||||
material_inputs.node_tree = material_node_group(is_depth_plane)
|
||||
material_inputs.location = (-300.0, 350.0)
|
||||
material_inputs.inputs["Bump Scale"].default_value = depth_scale
|
||||
if not is_depth_plane:
|
||||
material_inputs.inputs["Alpha Fix"].default_value = float(
|
||||
configured_material_view_adaptation()
|
||||
)
|
||||
if "Object Space" in material_inputs.inputs:
|
||||
if normal_space not in {"TANGENT", "OBJECT"}:
|
||||
raise ValueError(f"Unsupported normal space: {normal_space}")
|
||||
@@ -201,8 +204,7 @@ def create_image_material(
|
||||
else:
|
||||
shader = nodes.new("ShaderNodeBsdfPrincipled")
|
||||
shader.location = (250.0, 400.0)
|
||||
if ior is not None:
|
||||
shader.inputs["IOR"].default_value = float(ior)
|
||||
shader.inputs["IOR"].default_value = 1.2
|
||||
|
||||
links.new(
|
||||
material_inputs.outputs["Color"],
|
||||
|
||||
Reference in New Issue
Block a user