Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-02-24 13:37:31 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-24 13:38:11 +0300
commitf95373003e19e7eea0d13d69c36e3e33ddc3ed80 (patch)
tree5f08a37b8315178a0a39aeeadc757edbf9ac75f5 /archimesh
parent9920e00e5fbeee555ce0bef48b86ce4994a443f1 (diff)
Fix T73794: Archimesh error adding materials
Fix by @nacioss Differential revision: https://developer.blender.org/D6917
Diffstat (limited to 'archimesh')
-rw-r--r--archimesh/achm_tools.py15
1 files changed, 5 insertions, 10 deletions
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