Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-03-09 20:33:33 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-03-10 19:03:38 +0300
commitcf2933c38a34b16bf00f7e888374a8f51d10a1ee (patch)
tree0f206ce9444209739851dabf07b2500691107941 /source/blender/nodes/geometry/node_geometry_tree.cc
parenteb20250d2a51cb6152c086a7f42194b95b67d9fd (diff)
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
Diffstat (limited to 'source/blender/nodes/geometry/node_geometry_tree.cc')
-rw-r--r--source/blender/nodes/geometry/node_geometry_tree.cc12
1 files changed, 12 insertions, 0 deletions
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<bNodeTreeType *>(
@@ -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);
}