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:
authorHans Goudey <h.goudey@me.com>2022-10-07 20:32:23 +0300
committerHans Goudey <h.goudey@me.com>2022-10-07 20:32:23 +0300
commitf63179cc9fef42cc4f8b126d92b08f8b0d07dd87 (patch)
treefb9ae28418376c453348d75f55f400887d828474 /source/blender/editors/space_node
parentf96b729d7b5a6406fab07108b1cbbbd07b635d51 (diff)
Fix T101424: Empty group node added to node add search
The group node type polls true, but adding an empty group node isn't useful, so just skip it.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/add_node_search.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/add_node_search.cc b/source/blender/editors/space_node/add_node_search.cc
index cdf20f7b76e..819f0abac7c 100644
--- a/source/blender/editors/space_node/add_node_search.cc
+++ b/source/blender/editors/space_node/add_node_search.cc
@@ -178,6 +178,10 @@ static void gather_add_node_operations(const bContext &C,
if (!(node_type->poll && node_type->poll(node_type, &node_tree, &disabled_hint))) {
continue;
}
+ if ((StringRefNull(node_tree.typeinfo->group_idname) == node_type->idname)) {
+ /* Skip the empty group type. */
+ continue;
+ }
AddNodeItem item{};
item.ui_name = IFACE_(node_type->ui_name);
@@ -271,7 +275,7 @@ static void add_node_search_exec_fn(bContext *C, void *arg1, void *arg2)
static ARegion *add_node_search_tooltip_fn(
bContext *C, ARegion *region, const rcti *item_rect, void * /*arg*/, void *active)
{
- const AddNodeItem *item = static_cast<AddNodeItem *>(active);
+ const AddNodeItem *item = static_cast<const AddNodeItem *>(active);
uiSearchItemTooltipData tooltip_data{};