[Bf-blender-cvs] [79bc4962d37] master: Fix T86416: geometry nodes crash choosing a group node link menu
Philipp Oeser
noreply at git.blender.org
Wed Mar 10 17:04:45 CET 2021
Commit: 79bc4962d376a37356752334d43021a18fbdba5b
Author: Philipp Oeser
Date: Tue Mar 9 18:23:02 2021 +0100
Branches: master
https://developer.blender.org/rB79bc4962d376a37356752334d43021a18fbdba5b
Fix T86416: geometry nodes crash choosing a group node link menu
Since rBb279fef85d1a, the nodes properties for geometry nodes using a
texture are displayed in the Properties Editor.
It was possible to create recursive nodetrees when choosing the 'root'
nodegroup in the node link menu though leading to a crash.
Now poll if a group node of a particular node could actually be added to
the current tree.
Also check if the tree types actually match.
Maniphest Tasks: T86416
Differential Revision: https://developer.blender.org/D10671
===================================================================
M source/blender/editors/space_node/node_templates.c
===================================================================
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index b0c0f660717..3873985d93a 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -330,6 +330,10 @@ static void ui_node_link_items(NodeLinkArg *arg,
int i;
for (ngroup = arg->bmain->nodetrees.first; ngroup; ngroup = ngroup->id.next) {
+ if ((ngroup->type != arg->ntree->type) || !nodeGroupPoll(arg->ntree, ngroup)) {
+ continue;
+ }
+
ListBase *lb = ((in_out == SOCK_IN) ? &ngroup->inputs : &ngroup->outputs);
totitems += BLI_listbase_count(lb);
}
@@ -339,6 +343,10 @@ static void ui_node_link_items(NodeLinkArg *arg,
i = 0;
for (ngroup = arg->bmain->nodetrees.first; ngroup; ngroup = ngroup->id.next) {
+ if ((ngroup->type != arg->ntree->type) || !nodeGroupPoll(arg->ntree, ngroup)) {
+ continue;
+ }
+
ListBase *lb = (in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs);
bNodeSocket *stemp;
int index;
More information about the Bf-blender-cvs
mailing list