[Bf-extensions-cvs] [f9537300] master: Fix T73794: Archimesh error adding materials
Antonio Vazquez
noreply at git.blender.org
Mon Feb 24 11:38:22 CET 2020
Commit: f95373003e19e7eea0d13d69c36e3e33ddc3ed80
Author: Antonio Vazquez
Date: Mon Feb 24 11:37:31 2020 +0100
Branches: master
https://developer.blender.org/rBAf95373003e19e7eea0d13d69c36e3e33ddc3ed80
Fix T73794: Archimesh error adding materials
Fix by @nacioss
Differential revision: https://developer.blender.org/D6917
===================================================================
M archimesh/achm_tools.py
===================================================================
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
More information about the Bf-extensions-cvs
mailing list