Fix #105040: Adjust Real Snow addon to Principled BSDF changes #105042

Merged
Jesse Yurkovich merged 2 commits from deadpin/blender-addons:fix105040-snow into main 2023-12-04 17:49:48 +01:00

View File

@ -6,8 +6,8 @@ bl_info = {
"name": "Real Snow", "name": "Real Snow",
"description": "Generate snow mesh", "description": "Generate snow mesh",
"author": "Marco Pavanello, Drew Perttula", "author": "Marco Pavanello, Drew Perttula",
"version": (1, 3), "version": (1, 3, 1),
"blender": (3, 1, 0), "blender": (4, 0, 0),
"location": "View 3D > Properties Panel", "location": "View 3D > Properties Panel",
"doc_url": "{BLENDER_MANUAL_URL}/addons/object/real_snow.html", "doc_url": "{BLENDER_MANUAL_URL}/addons/object/real_snow.html",
"tracker_url": "https://gitlab.com/marcopavanello/real-snow/-/issues", "tracker_url": "https://gitlab.com/marcopavanello/real-snow/-/issues",
@ -273,20 +273,19 @@ def add_material(obj: bpy.types.Object):
coord.location = (-1900, 0) coord.location = (-1900, 0)
# Change node parameters # Change node parameters
principled.distribution = "MULTI_GGX" principled.distribution = "MULTI_GGX"
principled.subsurface_method = "RANDOM_WALK" principled.subsurface_method = "RANDOM_WALK_SKIN"
principled.inputs[0].default_value[0] = 0.904 principled.inputs[0].default_value[0] = 0.904 # Base color
principled.inputs[0].default_value[1] = 0.904 principled.inputs[0].default_value[1] = 0.904
principled.inputs[0].default_value[2] = 0.904 principled.inputs[0].default_value[2] = 0.904
principled.inputs[1].default_value = 1 principled.inputs[7].default_value = 1 # Subsurface weight
principled.inputs[2].default_value[0] = 0.36 principled.inputs[9].default_value = 1 # Subsurface scale
principled.inputs[2].default_value[1] = 0.46 principled.inputs[8].default_value[0] = 0.36 # Subsurface radius
principled.inputs[2].default_value[2] = 0.6 principled.inputs[8].default_value[1] = 0.46
principled.inputs[3].default_value[0] = 0.904 principled.inputs[8].default_value[2] = 0.6
principled.inputs[3].default_value[1] = 0.904 principled.inputs[12].default_value = 0.224 # Specular
principled.inputs[3].default_value[2] = 0.904 principled.inputs[2].default_value = 0.1 # Roughness
principled.inputs[7].default_value = 0.224 principled.inputs[19].default_value = 0.1 # Coat roughness
principled.inputs[9].default_value = 0.1 principled.inputs[20].default_value = 1.2 # Coat IOR
principled.inputs[15].default_value = 0.1
vec_math.operation = "MULTIPLY" vec_math.operation = "MULTIPLY"
vec_math.inputs[1].default_value[0] = 0.5 vec_math.inputs[1].default_value[0] = 0.5
vec_math.inputs[1].default_value[1] = 0.5 vec_math.inputs[1].default_value[1] = 0.5
@ -321,7 +320,7 @@ def add_material(obj: bpy.types.Object):
# Link nodes # Link nodes
link = mat.node_tree.links link = mat.node_tree.links
link.new(principled.outputs[0], output.inputs[0]) link.new(principled.outputs[0], output.inputs[0])
link.new(vec_math.outputs[0], principled.inputs[2]) link.new(vec_math.outputs[0], principled.inputs[8])
link.new(com_xyz.outputs[0], vec_math.inputs[0]) link.new(com_xyz.outputs[0], vec_math.inputs[0])
link.new(dis.outputs[0], output.inputs[2]) link.new(dis.outputs[0], output.inputs[2])
link.new(mul1.outputs[0], dis.inputs[0]) link.new(mul1.outputs[0], dis.inputs[0])
@ -329,7 +328,7 @@ def add_material(obj: bpy.types.Object):
link.new(add2.outputs[0], add1.inputs[0]) link.new(add2.outputs[0], add1.inputs[0])
link.new(mul2.outputs[0], add2.inputs[0]) link.new(mul2.outputs[0], add2.inputs[0])
link.new(mul3.outputs[0], add2.inputs[1]) link.new(mul3.outputs[0], add2.inputs[1])
link.new(range1.outputs[0], principled.inputs[14]) link.new(range1.outputs[0], principled.inputs[18])
link.new(range2.outputs[0], mul3.inputs[0]) link.new(range2.outputs[0], mul3.inputs[0])
link.new(range3.outputs[0], add1.inputs[1]) link.new(range3.outputs[0], add1.inputs[1])
link.new(vor.outputs[4], range1.inputs[0]) link.new(vor.outputs[4], range1.inputs[0])