Skip to content
Snippets Groups Projects
Commit ba19a9a7 authored by Robert Guetzkow's avatar Robert Guetzkow
Browse files

Fix T75393: Archipack thumbs find shader node by type

Find the Principle BSDF by type instead of assuming that it's the node
with index 1.

Reviewed By: stephen_leger

Differential Revision: https://developer.blender.org/D7338
parent 34f60e3b
Branches
Tags
No related merge requests found
...@@ -77,7 +77,10 @@ def get_center(o): ...@@ -77,7 +77,10 @@ def get_center(o):
def apply_simple_material(o, name, color): def apply_simple_material(o, name, color):
m = bpy.data.materials.new(name) m = bpy.data.materials.new(name)
m.use_nodes = True m.use_nodes = True
m.node_tree.nodes[1].inputs[0].default_value = color for node in m.node_tree.nodes:
if node.bl_idname == "ShaderNodeBsdfPrincipled":
node.inputs[0].default_value = color
break
o.data.materials.append(m) o.data.materials.append(m)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment