I noticed the addon for the Renderman Render Engine for Blender added its own custom nodes for shaders.

I wanted to know how I can do this, and write my own python code for them.

For example, I wanted to create a node that would take in 2 values, and depending on a condition, return either. (like an if statement)

Im quite new to python and add-ons in general, but I already have some experience in python, I just wanted to know how to create my own nodes.

Where in the API should I be looking..

  • 2
    $\begingroup$ I believe you can't actually add new nodes via a python addon: you would need to write a new one as part of the cpp code and rebuild your own version of blender. another option could be using OSL to make custom nodes (docs.blender.org/manual/en/latest/render/shader_nodes/osl.html) $\endgroup$
    – person132
    Jul 18, 2021 at 3:15
  • $\begingroup$ You could also set up node groups that python can instantiate. This has been done with things like material library VX. $\endgroup$
    – TheLabCat
    Jul 18, 2021 at 17:26
  • $\begingroup$ Try dissecting the blend file in this answer, be sure to upvote if it helps - blender.stackexchange.com/a/223815/110840 $\endgroup$ Jul 18, 2021 at 20:36
  • $\begingroup$ @person132 Renderman Blender addon added its own custom nodes. It doesnt use a custom install, its just an addon. $\endgroup$ Jul 19, 2021 at 2:59


You must log in to answer this question.

Browse other questions tagged .