diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-03-14 01:07:55 +0300 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-03-14 01:07:55 +0300 |
commit | 24f72abf67c8c836e238484d261ae6d4aa45782b (patch) | |
tree | 39cbbbe143488e236f1f496af34a564c6e3455cb /source/blender/editors/space_node/node_draw.c | |
parent | 1e4010cad67a2bf6f80fa574ac16985e7c7a513e (diff) |
Fix for crashes due to links without fromnode pointers. This can happen with "unfinished" links created during the modal linking operator or when creating links from group tree inputs.
In addition don't store unfinished links in the nodetree->links list any more. This makes code a bit safer because all links in that list can be considered valid now. The temporary bNodeLinkDrag structs used by the modal linking operator are now also stored in a list in SpaceNode, so these links can be drawn too (this separation also allows different display of temporary links, e.g. currently they are drawn on top of all nodes).
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index f1261f1e6f5..c5221d45837 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -991,6 +991,7 @@ static void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, { bNode *node; bNodeLink *link; + bNodeLinkDrag *nldrag; int a; if(ntree==NULL) return; /* groups... */ @@ -1025,6 +1026,14 @@ static void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, node_draw_basis(C, ar, snode, ntree, node); } } + + /* temporary links */ + glEnable(GL_BLEND); + glEnable(GL_LINE_SMOOTH); + for(nldrag= snode->linkdrag.first; nldrag; nldrag= nldrag->next) + node_draw_link(&ar->v2d, snode, nldrag->link); + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); } static void group_verify_cb(bContext *UNUSED(C), void *UNUSED(snode_v), void *ngroup_v) |