diff --git a/armory/blender/arm/material/cycles.py b/armory/blender/arm/material/cycles.py index 55ea32733..1876c5889 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', diff --git a/armory/blender/arm/material/cycles_nodes/nodes_shader.py b/armory/blender/arm/material/cycles_nodes/nodes_shader.py index c009db465..91913ce04 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: diff --git a/armory/blender/arm/material/cycles_nodes/nodes_texture.py b/armory/blender/arm/material/cycles_nodes/nodes_texture.py index 013b3eeaf..6467f5cb6 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 diff --git a/armory/blender/arm/material/node_meta.py b/armory/blender/arm/material/node_meta.py index 5df5f06b5..b3da66a76 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: