Can't see my new custom Geometry Node

I’ve been trying to get into creating custom geometry nodes using this fairly recent tutorial: https://www.youtube.com/watch?v=pg9PeIv38hE

I’ve followed all the instructions but even though I can confirm that my node has it’s node_register function called when Blender starts (printf shows up in console), the node itself is nowhere to be found in the add menu or when I search for it. Has something changed about what needs to be added to introduce a new node to the codebase?

I’m currently on 4.4.0 alpha and I’m using Visual Studio 2022 as IDE and to compile.

These are the changes I’ve made:

I’ve added the file source\blender\nodes\geometry\nodes\node_geo_mrblobby.cc with the following content:

#include "BKE_pointcloud.hh"
#include "node_geometry_util.hh"

namespace blender::nodes::node_geo_mrblobby_cc {

	static void node_declare(NodeDeclarationBuilder& b){
    b.add_output<decl::Geometry>("Geometry").propagate_all();
	}

	static void node_geo_execute(GeoNodeExecParams params) {

	}

  static void node_register()
	{
    static blender::bke::bNodeType ntype;
    printf("blobby node registered!\n");
		geo_node_type_base(&ntype, GEO_NODE_MR_BLOBBY, "Make Mr. Blobby come out", NODE_CLASS_GEOMETRY);
		ntype.declare = node_declare;
		ntype.geometry_node_execute = node_geo_execute;
    blender::bke::node_register_type(&ntype);
	}

	NOD_REGISTER_NODE(node_register);
}

I’ve added this file to source\blender\nodes\geometry\CMakeLists.txt:

set(SRC
  nodes/node_geo_mrblobby.cc
(other files follow)
...

Added this constant with a unique value to BKE_node.hh:

#define GEO_NODE_MR_BLOBBY 2151

Added this line to NOD_static_types.h:

DefNode(GeometryNode, GEO_NODE_MR_BLOBBY, 0, "MR_BLOBBY", MrBlobby, "Mr. Blobby", "Make Mr. Blobby come out")

According to the video I should already see my node in the add node menu but I don’t see it.

In general: How does Blender know what submenu (like “Read” “Write” etc) to place the nodes in? I don’t really see that defined anywhere.

Try to check scripts/startup/bl_ui/node_add_menu_geometry.py/

1 Like

Yes! That was what was missing! Thank you!

By adding the last line here it suddenly showed up and I was able to add the node to the network:

class NODE_MT_geometry_node_GEO_GEOMETRY(Menu):
...
    def draw(self, _context):
        ...
        node_add_menu.add_node_type(layout, "GeometryNodeMrBlobby")
1 Like