0
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ 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 $\endgroup$
    – batFINGER
    Commented Apr 7, 2021 at 7:37
  • $\begingroup$ Okay, I solved the answer finally $\endgroup$
    – 8N Films
    Commented Apr 7, 2021 at 7:50

1 Answer 1

-1
$\begingroup$

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

$\endgroup$

Not the answer you're looking for? Browse other questions tagged .