From cf2933c38a34b16bf00f7e888374a8f51d10a1ee Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 9 Mar 2021 18:33:33 +0100 Subject: Add 'foreach_nodeclass' for geometry nodetrees This way we get a choice when we click on node links in the Properties Editor. This also changes some of the more permissive poll functions on some nodes back to being "shading-only" (these were made permissive in rBb78f2675d7e5 for simulation nodes, but have not found their way into geometry nodes yet). ref b279fef85d1a / T86416 / D10671 Maniphest Tasks: T86416 Differential Revision: https://developer.blender.org/D10673 --- source/blender/nodes/geometry/node_geometry_tree.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/nodes/geometry/node_geometry_tree.cc') diff --git a/source/blender/nodes/geometry/node_geometry_tree.cc b/source/blender/nodes/geometry/node_geometry_tree.cc index 87178c52ab9..2c4c7da64cc 100644 --- a/source/blender/nodes/geometry/node_geometry_tree.cc +++ b/source/blender/nodes/geometry/node_geometry_tree.cc @@ -71,6 +71,17 @@ static void geometry_node_tree_update(bNodeTree *ntree) ntree_update_reroute_nodes(ntree); } +static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCallback func) +{ + func(calldata, NODE_CLASS_INPUT, N_("Input")); + func(calldata, NODE_CLASS_GEOMETRY, N_("Geometry")); + func(calldata, NODE_CLASS_ATTRIBUTE, N_("Attribute")); + func(calldata, NODE_CLASS_OP_COLOR, N_("Color")); + func(calldata, NODE_CLASS_OP_VECTOR, N_("Vector")); + func(calldata, NODE_CLASS_CONVERTOR, N_("Convertor")); + func(calldata, NODE_CLASS_LAYOUT, N_("Layout")); +} + void register_node_tree_type_geo(void) { bNodeTreeType *tt = ntreeType_Geometry = static_cast( @@ -83,6 +94,7 @@ void register_node_tree_type_geo(void) tt->rna_ext.srna = &RNA_GeometryNodeTree; tt->update = geometry_node_tree_update; tt->get_from_context = geometry_node_tree_get_from_context; + tt->foreach_nodeclass = foreach_nodeclass; ntreeTypeAdd(tt); } -- cgit v1.2.3