I have a custom node tree called MyCustomTreeType. I know that there are scripts to add nodes to the composite and material node trees: Controling compositor by python
How can I use this with my custom tree?
The example of the custom PyNode tree includes information about how to add nodes to the menus via
NodeCategory so i'm going to assume you've got menus working.
(if not: see TextEditor > Templates > Python > Custom Nodes )
If you want to add a node via python, it's the same as with shader trees or compositor trees, except you use
ng = bpy.data.node_groups['MyNodeTree'] new_node = ng.nodes.new(your_nodes_bl_idname) new_node.location = (20, 40)