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:23:02 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-03-10 19:03:38 +0300
commit79bc4962d376a37356752334d43021a18fbdba5b (patch)
tree038999bc19dc74e3f5e88c9fd6fb94d3b38db39b /source/blender/editors
parentcf2933c38a34b16bf00f7e888374a8f51d10a1ee (diff)
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
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_node/node_templates.c8
1 files changed, 8 insertions, 0 deletions
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;