0

I am scripting an add-on and I need to create link between Glossy BSDF node and Mix shader node's "shader" material_realistic_gold.node_tree.links.new(BsdfGlossy3_node.outputs[0], MixShader_node.outputs.inputs[0]) This is not working and get an error

Python: Traceback (most recent call last):
  File "C:\Users\Yeung\Downloads\Shader 1.0\Script 001.blend\test.py", line 237, in execute
AttributeError: 'bpy_prop_collection' object has no attribute 'inputs'

location: <unknown location>:-1

What is the script of input shader of Mix material node?want to script shader connect like this

8N Films
  • 163
  • 1
  • 12
  • My 2c worth here is try and work out the error from the error message before asking a question here. Even to the extent of disconnecting from the net. (for a period of time) This applies to me too... often weighing up helpful vs distraction. Take a closer look at MixShader_node.outputs.inputs – batFINGER Apr 07 '21 at 07:37
  • Okay, I solved the answer finally – 8N Films Apr 07 '21 at 07:50

1 Answers1

-1

I finally figure it out I need to type material_realistic_gold.node_tree.links.new(MixShader_node.inputs[1], BsdfGlossy3_node.outputs[0])

8N Films
  • 163
  • 1
  • 12