How To Create Custom Node Type

Hello, I would like to create my own node type like “MixRGB” or “Wireframe” nodes. Is there anything that can help me ?

You can create basic nodes by combining existing nodes into node groups in the shader editor. https://docs.blender.org/manual/en/latest/interface/controls/nodes/groups.html

Creating shader nodes from scratch is not something you can do in Python. You need to write the nodes in C++ and patch the Blender base.

You can write advanced shaders using OSL (CPU only). In theory you can write some Python code that can create the OSL node and fill it with the desired code content.

1 Like

You can make custom nodes in python, even extend existing node classes. But you can really only define behaviours for the user interface or for your own script/add-on.

There isn’t really anything you can do in relation to how a material will render. For that as @kkar said you would need to write the function in C++ and compile it into blender. OSL is your only other option.

2 Likes

I don’t make shader nodes. I will create something with color input and color output.

Can you explain exactly what you want to do? If it’s just user interface stuff, it might be possible by extending an existing node type.