From d64d4a8bba739b6f80c78c6bed70ad3902a13442 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Thu, 19 Dec 2024 18:19:26 +0100 Subject: [PATCH 1/4] Update cycles.py --- armory/blender/arm/material/cycles.py | 1 + 1 file changed, 1 insertion(+) diff --git a/armory/blender/arm/material/cycles.py b/armory/blender/arm/material/cycles.py index 55ea327335..1876c58895 100644 --- a/armory/blender/arm/material/cycles.py +++ b/armory/blender/arm/material/cycles.py @@ -217,6 +217,7 @@ def parse_shader(node: bpy.types.Node, socket: bpy.types.NodeSocket) -> Tuple[st 'BSDF_PRINCIPLED', 'BSDF_DIFFUSE', 'BSDF_GLOSSY', + 'BSDF_SHEEN', 'AMBIENT_OCCLUSION', 'BSDF_ANISOTROPIC', 'EMISSION', From 6afe48bb11d2a7faaf5155139c990b0d9dbefd59 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Thu, 19 Dec 2024 18:28:21 +0100 Subject: [PATCH 2/4] Update nodes_texture.py --- armory/blender/arm/material/cycles_nodes/nodes_texture.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/armory/blender/arm/material/cycles_nodes/nodes_texture.py b/armory/blender/arm/material/cycles_nodes/nodes_texture.py index 013b3eeaff..6467f5cb61 100644 --- a/armory/blender/arm/material/cycles_nodes/nodes_texture.py +++ b/armory/blender/arm/material/cycles_nodes/nodes_texture.py @@ -285,7 +285,11 @@ def parse_tex_noise(node: bpy.types.ShaderNodeTexNoise, out_socket: bpy.types.No # Fac else: res = 'tex_noise({0} * {1},{2},{3})'.format(co, scale, detail, distortion) - + if bpy.app.version >= (4, 1, 0): + # Needs a switch for the new set of types for noise where the musgrave was moved + if node.noise_type == "FBM" + state.curshader.add_function(c_functions.str_tex_musgrave) + res = f'tex_musgrave_f({co} * {scale} * 1.0)' return res From cea55af225cb0011eb004bcb76e32872bacd12a9 Mon Sep 17 00:00:00 2001 From: 1k8 Date: Thu, 19 Dec 2024 18:35:00 +0100 Subject: [PATCH 3/4] Update node_meta.py --- armory/blender/arm/material/node_meta.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/armory/blender/arm/material/node_meta.py b/armory/blender/arm/material/node_meta.py index 5df5f06b5c..b3da66a764 100644 --- a/armory/blender/arm/material/node_meta.py +++ b/armory/blender/arm/material/node_meta.py @@ -205,7 +205,9 @@ class MaterialNodeMeta: if bpy.app.version < (4, 1, 0): ALL_NODES['BSDF_VELVET'] = MaterialNodeMeta(parse_func=nodes_shader.parse_bsdfvelvet) ALL_NODES['TEX_MUSGRAVE'] = MaterialNodeMeta(parse_func=nodes_texture.parse_tex_musgrave) - +if bpy.app.version >= (4, 0, 0): + ALL_NODES['BSDF_SHEEN'] = MaterialNodeMeta(parse_func=nodes_shader.parse_bsdfsheen) + ALL_NODES['BSDF_GLOSSY'] = MaterialNodeMeta(parse_func=nodes_shader.parse_bsdfglossy) def get_node_meta(node: bpy.types.Node) -> MaterialNodeMeta: From 3383c255251081d612a47454e4a0ab990514590a Mon Sep 17 00:00:00 2001 From: 1k8 Date: Thu, 19 Dec 2024 18:36:46 +0100 Subject: [PATCH 4/4] Update nodes_shader.py --- armory/blender/arm/material/cycles_nodes/nodes_shader.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/armory/blender/arm/material/cycles_nodes/nodes_shader.py b/armory/blender/arm/material/cycles_nodes/nodes_shader.py index c009db465a..91913ce044 100644 --- a/armory/blender/arm/material/cycles_nodes/nodes_shader.py +++ b/armory/blender/arm/material/cycles_nodes/nodes_shader.py @@ -176,6 +176,12 @@ def parse_bsdfdiffuse(node: bpy.types.ShaderNodeBsdfDiffuse, out_socket: NodeSoc state.out_roughness = c.parse_value_input(node.inputs[1]) state.out_specular = '0.0' +if bpy.app.version >= (4, 0, 0): + def parse_bsdfsheen(node: bpy.types.ShaderNodeBsdfSheen, out_socket: NodeSocket, state: ParserState) -> None: + if state.parse_surface: + c.write_normal(node.inputs[2]) + state.out_basecol = c.parse_vector_input(node.inputs[0]) + state.out_roughness = c.parse_value_input(node.inputs[1]) if bpy.app.version < (4, 1, 0): def parse_bsdfglossy(node: bpy.types.ShaderNodeBsdfGlossy, out_socket: NodeSocket, state: ParserState) -> None: