diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 00:26:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-15 00:26:23 +0400 |
commit | bc98d4e383d21834d074c64adb85ec4de7c84a7c (patch) | |
tree | acd93b034fb40b00a5a7cc91d5f309ad8e9b276c /source | |
parent | 2ab2423b06a81b8bccbe496f33a8a1fc8a8204ae (diff) |
Fix #29238: crash with node dependency loop.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index fedb12f747c..c99a0be15dc 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -552,6 +552,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *lnode; char label[UI_MAX_NAME_STR]; int indent = (depth > 1)? 2*(depth - 1): 0; + int dependency_loop; if(input->flag & SOCK_UNAVAIL) return; @@ -560,6 +561,10 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, node->flag |= NODE_TEST; lnode = (input->link)? input->link->fromnode: NULL; + dependency_loop = (lnode && (lnode->flag & NODE_TEST)); + if(dependency_loop) + lnode = NULL; + /* socket RNA pointer */ RNA_pointer_create(&ntree->id, &RNA_NodeSocket, input, &inputptr); @@ -593,7 +598,11 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, bt= block->buttons.last; bt->flag= UI_TEXT_LEFT; - if(lnode) { + if(dependency_loop) { + row = uiLayoutRow(split, 0); + uiItemL(row, "Dependency Loop", ICON_ERROR); + } + else if(lnode) { /* input linked to a node */ uiTemplateNodeLink(split, ntree, node, input); |