Implement a custom node to the Shader Editor

Hi

I wrote a script that let’s the user input a math formula in a node as a string and converts it to a float result (https://blender.community/c/rightclickselect/3yfbbc/#5e7dc4209c1221780206883d).
Now I’m trying to implement it as a node to Blender in the shader editor. I tried it with the text editor template “Custom Nodes” but this creates a new node tree editor instead getting my node to the shader editor. I tried to do it by myself but didn’t work (https://github.com/CultLess/String-To-Function-Node).

Anyone knows how get a node into the shader editor?

Marc

Custom Nodes template is for creating custom nodetrees.

Templates for creating shading nodes for Cycles are inside Open Shading Language section.
You can script your own nodes for Cycles.
https://docs.blender.org/manual/fr/2.79/render/cycles/nodes/osl.html

But for EEVEE, you will have to wait that render engine become more mature.

For builtin Nodetrees you should use NodeCustomGroups instead. In particular for the Shader Editor, ShaderNodeCustomGroup is the best choice since it will also work with Eevee.

Here’s an addon that does what you’re describing using NodeCustomGroups: https://github.com/baldingwizard/Blender-Addons/tree/master/MathsExpressionLiteBlender28