0

I am terribly confused why this is not working. I have followed similar examples and failed (i.e. Blender scripting connect nodes)

bpy.context.active_object.active_material.node_tree.links.new(bpy.data.materials["Material.001"].node_tree.nodes["Principled BSDF"].inputs[0], bpy.data.materials["Material.001"].node_tree.nodes["ShaderNodeTexCoord"].outputs[0])

If my code is too difficult to decipher, here's a summary: I am just trying to link the Texture Coordinate node output to the Base Color input of the Principled BSDF.

I wrote out the whole line above without using any variables in the aid of clarity/searchability.

Thank you all!

1 Answers1

0

make sure your name is set to right value, not just the label.

"enter image description here

Chris
  • 59,454
  • 6
  • 30
  • 84
  • If the active objects active material is not material "Material.001" then code in question won't work... could be another guess-timate. – batFINGER Apr 14 '21 at 20:01
  • Nobody with little python experience would code it in that way - so I totally agree with you – Chris Apr 15 '21 at 00:28