-1
$\begingroup$

I have Created a Material and Added Some Nodes using Python Script. Now I wan't To Add Some Nodes To Compositor using Python How to do that ? Can anyone tell that directly or Should I share the Code Which I wrote Earlier to create a Material and adding some diffuse and glossy nodes.

$\endgroup$
-1
$\begingroup$

Finally I got the Answer and this Link Controling compositor by python has some Errors in the solution so i have finally solved this question with the help of that reference and thanks for Commenting the link Error is

# link nodes
links = tree.links
link = links.new(image_node.outputs[0], comp_node.inputs[0])

error in the second line

link = links.new(image_node.outputs[0], comp_node.inputs[0])

in place of link =,

According to me it will be links =

$\endgroup$
  • 1
    $\begingroup$ What errors? Can you elaborate? $\endgroup$ – brockmann Nov 24 '19 at 16:25
  • 1
    $\begingroup$ Nope, there is nothing wrong. tree.links just holds all links/noodle connections. To store the newly created connection between the 'Image Node' and the 'Output Node' you can create a variable and name it whatever you like, e.g. rakesh = links.new(...) will also work... $\endgroup$ – brockmann Nov 24 '19 at 17:08
  • $\begingroup$ Thanks for that You Explained me that! $\endgroup$ – Rakesh choudhary Nov 24 '19 at 17:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.