From 0d7bd0f9b63db4c7891137d18ae6a40e652e190f Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Wed, 19 Oct 2011 17:08:35 +0000 Subject: Adds an update flag to the bNode struct (similar to bNodeTree->update). This prevents access to non-existent typeinfo during type initialization, when node types have been removed and such nodes are deleted from older files. All blenkernel functions now only set the node->update flag instead of directly calling the update function. All operators, etc. calling blenkernel functions to modify nodes should make a ntreeUpdate call afterward (they already did that anyway). Editor/RNA/renderer/etc. high-level functions still can do immediate updates by using nodeUpdate and nodeUpdateID (replacing NodeTagChanged/NodeTagIDChanged respectively). These old functions were previously used only for setting compositor node needexec flags and clearing cached data, but have become generic update functions that require type-specific functionality (i.e. a valid typeinfo struct). --- source/blender/makesrna/intern/rna_nodetree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_nodetree.c') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 061a21056d0..7d20378d55e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -568,7 +568,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor } else { ntreeUpdateTree(ntree); /* update group node socket links*/ - NodeTagChanged(ntree, node); + nodeUpdate(ntree, node); WM_main_add_notifier(NC_NODE|NA_EDITED, ntree); if (group) @@ -651,7 +651,7 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports, b ret= nodeAddLink(ntree, fromnode, in, tonode, out); if(ret) { - NodeTagChanged(ntree, tonode); + nodeUpdate(ntree, tonode); ntreeUpdateTree(ntree); -- cgit v1.2.3