From f95373003e19e7eea0d13d69c36e3e33ddc3ed80 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 24 Feb 2020 11:37:31 +0100 Subject: Fix T73794: Archimesh error adding materials Fix by @nacioss Differential revision: https://developer.blender.org/D6917 --- archimesh/achm_tools.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'archimesh') diff --git a/archimesh/achm_tools.py b/archimesh/achm_tools.py index 4aab64c4..0527d330 100644 --- a/archimesh/achm_tools.py +++ b/archimesh/achm_tools.py @@ -333,10 +333,8 @@ def create_diffuse_material(matname, replace, r, g, b, rv=0.8, gv=0.8, bv=0.8, m nodes = mat.node_tree.nodes # support for multilanguage - node = nodes[get_node_index(nodes, 'BSDF_DIFFUSE')] + node = nodes.new('ShaderNodeBsdfDiffuse') node.name = 'Diffuse BSDF' - node.label = 'Diffuse BSDF' - node.inputs[0].default_value = [r, g, b, 1] node.location = 200, 320 @@ -417,10 +415,8 @@ def create_translucent_material(matname, replace, r, g, b, rv=0.8, gv=0.8, bv=0. nodes = mat.node_tree.nodes # support for multilanguage - node = nodes[get_node_index(nodes, 'BSDF_DIFFUSE')] + node = nodes.new('ShaderNodeBsdfDiffuse') node.name = 'Diffuse BSDF' - node.label = 'Diffuse BSDF' - node.inputs[0].default_value = [r, g, b, 1] node.location = 200, 320 @@ -500,7 +496,8 @@ def create_glass_material(matname, replace, rv=0.333, gv=0.342, bv=0.9): node.inputs[0].default_value = 0.1 node.location = 690, 290 - node = nodes[get_node_index(nodes, 'OUTPUT_MATERIAL')] + node = nodes.new('ShaderNodeOutputMaterial') + node.name = 'OUTPUT_MATERIAL' node.location = 920, 290 # Connect nodes @@ -786,10 +783,8 @@ def create_fabric_material(matname, replace, r, g, b, rv=0.8, gv=0.636, bv=0.315 nodes = mat.node_tree.nodes # support for multilanguage - node = nodes[get_node_index(nodes, 'BSDF_DIFFUSE')] + node = nodes.new('ShaderNodeBsdfDiffuse') node.name = 'Diffuse BSDF' - node.label = 'Diffuse BSDF' - node.inputs[0].default_value = [r, g, b, 1] node.location = 810, 270 -- cgit v1.2.3