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:
-rw-r--r--source/blender/blenkernel/BKE_node.h2
-rw-r--r--source/blender/blenkernel/intern/node.c6
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/editors/space_node/node_add.c4
-rw-r--r--source/blender/editors/space_node/node_edit.c22
-rw-r--r--source/blender/editors/space_node/node_group.c14
-rw-r--r--source/blender/editors/space_node/node_relationships.c19
-rw-r--r--source/blender/editors/space_node/node_templates.c9
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c42
-rw-r--r--source/blender/nodes/intern/node_exec.c3
10 files changed, 64 insertions, 59 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index d0b3b47c361..d1c16cc1185 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -358,7 +358,7 @@ struct bNodeTree *ntreeFromID(struct ID *id);
void ntreeMakeLocal(struct bNodeTree *ntree);
int ntreeHasType(struct bNodeTree *ntree, int type);
-void ntreeUpdateTree(struct bNodeTree *ntree);
+void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree);
/* XXX Currently each tree update call does call to ntreeVerifyNodes too.
* Some day this should be replaced by a decent depsgraph automatism!
*/
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index f41d6387e4e..03d4fc35f42 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2848,7 +2848,7 @@ void ntreeVerifyNodes(struct Main *main, struct ID *id)
} FOREACH_NODETREE_END
}
-void ntreeUpdateTree(bNodeTree *ntree)
+void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
{
bNode *node;
@@ -2886,8 +2886,8 @@ void ntreeUpdateTree(bNodeTree *ntree)
ntreeInterfaceTypeUpdate(ntree);
/* XXX hack, should be done by depsgraph!! */
- if (G.main)
- ntreeVerifyNodes(G.main, &ntree->id);
+ if (bmain)
+ ntreeVerifyNodes(bmain, &ntree->id);
if (ntree->update & (NTREE_UPDATE_LINKS | NTREE_UPDATE_NODES)) {
/* node updates can change sockets or links, repeat link pointer update afterward */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index fcd27e42c96..f0dfd0aa84e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2579,7 +2579,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
{
FOREACH_NODETREE(main, ntree, id) {
/* make an update call for the tree */
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(main, ntree);
} FOREACH_NODETREE_END
}
}
diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index 0425ec58f83..61fbde32f7a 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -93,7 +93,7 @@ bNode *node_add_node(const bContext *C, const char *idname, int type, float locx
node->locx = locx;
node->locy = locy + 60.0f;
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(bmain, snode->edittree);
ED_node_set_active(bmain, snode->edittree, node);
if (snode->nodetree->type == NTREE_COMPOSIT) {
@@ -285,7 +285,7 @@ static int add_reroute_exec(bContext *C, wmOperator *op)
BLI_freelistN(&input_links);
/* always last */
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
snode_notify(C, snode);
snode_dag_update(C, snode);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index b3e24a9d6ed..6c7ccf6264b 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -474,7 +474,7 @@ void ED_node_shader_default(const bContext *C, ID *id)
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
}
/* assumes nothing being done in ntree yet, sets the default in/out node */
@@ -513,7 +513,7 @@ void ED_node_composit_default(const bContext *C, struct Scene *sce)
tosock = out->inputs.first;
nodeAddLink(sce->nodetree, in, fromsock, out, tosock);
- ntreeUpdateTree(sce->nodetree);
+ ntreeUpdateTree(CTX_data_main(C), sce->nodetree);
// XXX ntreeCompositForceHidden(sce->nodetree);
}
@@ -545,7 +545,7 @@ void ED_node_texture_default(const bContext *C, Tex *tx)
tosock = out->inputs.first;
nodeAddLink(tx->nodetree, in, fromsock, out, tosock);
- ntreeUpdateTree(tx->nodetree);
+ ntreeUpdateTree(CTX_data_main(C), tx->nodetree);
}
/* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */
@@ -1222,7 +1222,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
break;
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -1557,7 +1557,7 @@ static int node_socket_toggle_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
WM_event_add_notifier(C, NC_NODE | ND_DISPLAY, NULL);
@@ -1636,7 +1636,7 @@ static int node_delete_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -1679,7 +1679,7 @@ static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -2071,7 +2071,7 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
link->tonode->new_node, link->tosock->new_sock);
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -2156,7 +2156,7 @@ static int ntree_socket_add_exec(bContext *C, wmOperator *op)
/* make the new socket active */
sock->flag |= SELECT;
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
WM_event_add_notifier(C, NC_NODE | ND_DISPLAY, NULL);
@@ -2202,7 +2202,7 @@ static int ntree_socket_remove_exec(bContext *C, wmOperator *UNUSED(op))
if (active_sock)
active_sock->flag |= SELECT;
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
WM_event_add_notifier(C, NC_NODE | ND_DISPLAY, NULL);
@@ -2270,7 +2270,7 @@ static int ntree_socket_move_exec(bContext *C, wmOperator *op)
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
WM_event_add_notifier(C, NC_NODE | ND_DISPLAY, NULL);
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index 64117627be4..9b445cfc82c 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -363,7 +363,7 @@ static int node_group_ungroup_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if (gnode->id && node_group_ungroup(snode->edittree, gnode)) {
- ntreeUpdateTree(snode->nodetree);
+ ntreeUpdateTree(CTX_data_main(C), snode->nodetree);
}
else {
BKE_report(op->reports, RPT_WARNING, "Cannot ungroup");
@@ -556,7 +556,7 @@ static int node_group_separate_exec(bContext *C, wmOperator *op)
/* switch to parent tree */
ED_node_tree_pop(snode);
- ntreeUpdateTree(snode->nodetree);
+ ntreeUpdateTree(CTX_data_main(C), snode->nodetree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -917,6 +917,7 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
const char *node_idname = group_node_idname(C);
bNodeTree *ngroup;
bNode *gnode;
+ Main *bmain = CTX_data_main(C);
ED_preview_kill_jobs(C);
@@ -931,11 +932,11 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
nodeSetActive(ntree, gnode);
if (ngroup) {
ED_node_tree_push(snode, ngroup, gnode);
- ntreeUpdateTree(ngroup);
+ ntreeUpdateTree(bmain, ngroup);
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(bmain, ntree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -967,6 +968,7 @@ static int node_group_insert_exec(bContext *C, wmOperator *op)
bNodeTree *ngroup;
const char *node_idname = group_node_idname(C);
bNode *gnode;
+ Main *bmain = CTX_data_main(C);
ED_preview_kill_jobs(C);
@@ -983,9 +985,9 @@ static int node_group_insert_exec(bContext *C, wmOperator *op)
nodeSetActive(ntree, gnode);
ED_node_tree_push(snode, ngroup, gnode);
- ntreeUpdateTree(ngroup);
+ ntreeUpdateTree(bmain, ngroup);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(bmain, ntree);
snode_notify(C, snode);
snode_dag_update(C, snode);
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 71989f3ee04..30f85c07e65 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -38,6 +38,7 @@
#include "BLI_blenlib.h"
#include "BKE_context.h"
+#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_node.h"
@@ -173,7 +174,7 @@ static int snode_autoconnect_input(SpaceNode *snode, bNode *node_fr, bNodeSocket
link = nodeAddLink(ntree, node_fr, sock_fr, node_to, sock_to);
/* validate the new link */
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
if (!(link->flag & NODE_LINK_VALID)) {
nodeRemLink(ntree, link);
return 0;
@@ -256,7 +257,7 @@ static void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
}
if (numlinks > 0) {
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
}
BLI_freelistN(nodelist);
@@ -347,7 +348,7 @@ static int node_link_viewer(const bContext *C, bNode *tonode)
/* make sure the dependency sorting is updated */
snode->edittree->update |= NTREE_UPDATE_LINKS;
}
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_update(snode, node);
}
@@ -532,7 +533,7 @@ static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event)
nodeRemLink(ntree, link);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -714,7 +715,7 @@ static int node_make_link_exec(bContext *C, wmOperator *op)
node_deselect_all_input_sockets(snode, 0);
node_deselect_all_output_sockets(snode, 0);
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -797,7 +798,7 @@ static int cut_links_exec(bContext *C, wmOperator *op)
}
if (found) {
- ntreeUpdateTree(snode->edittree);
+ ntreeUpdateTree(CTX_data_main(C), snode->edittree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -852,7 +853,7 @@ static int detach_links_exec(bContext *C, wmOperator *UNUSED(op))
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
snode_notify(C, snode);
snode_dag_update(C, snode);
@@ -881,7 +882,7 @@ static int node_show_cycles_exec(bContext *C, wmOperator *UNUSED(op))
SpaceNode *snode = CTX_wm_space_node(C);
/* this is just a wrapper around this call... */
- ntreeUpdateTree(snode->nodetree);
+ ntreeUpdateTree(CTX_data_main(C), snode->nodetree);
snode_notify(C, snode);
return OPERATOR_FINISHED;
@@ -1361,7 +1362,7 @@ void ED_node_link_insert(ScrArea *sa)
nodeAddLink(snode->edittree, select, best_output, node, sockto);
- ntreeUpdateTree(snode->edittree); /* needed for pointers */
+ ntreeUpdateTree(G.main, snode->edittree); /* needed for pointers */
snode_update(snode, select);
ED_node_tag_update_id(snode->id);
}
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index bac7791af2a..eaafb2b05d2 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -38,6 +38,7 @@
#include "BLF_translation.h"
#include "BKE_context.h"
+#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_scene.h"
@@ -85,7 +86,7 @@ static void node_link_item_apply(bNode *node, NodeLinkItem *item)
{
if (node->type == NODE_GROUP) {
node->id = (ID *)item->ngroup;
- ntreeUpdateTree(item->ngroup);
+ ntreeUpdateTree(G.main, item->ngroup);
}
else {
/* nothing to do for now */
@@ -166,7 +167,7 @@ static void node_socket_disconnect(Main *bmain, bNodeTree *ntree, bNode *node_to
sock_to->flag |= SOCK_COLLAPSED;
nodeUpdate(ntree, node_to);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(bmain, ntree);
ED_node_tag_update_nodetree(bmain, ntree);
}
@@ -181,7 +182,7 @@ static void node_socket_remove(Main *bmain, bNodeTree *ntree, bNode *node_to, bN
sock_to->flag |= SOCK_COLLAPSED;
nodeUpdate(ntree, node_to);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(bmain, ntree);
ED_node_tag_update_nodetree(bmain, ntree);
}
@@ -267,7 +268,7 @@ static void node_socket_add_replace(const bContext *C, bNodeTree *ntree, bNode *
nodeUpdate(ntree, node_from);
nodeUpdate(ntree, node_to);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
ED_node_tag_update_nodetree(CTX_data_main(C), ntree);
}
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7c7e35a8cb4..818caa82e1f 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -741,7 +741,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r
ntreeTexCheckCyclics(ntree);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(CTX_data_main(C), ntree);
nodeUpdate(ntree, node);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
@@ -764,7 +764,7 @@ static void rna_NodeTree_node_remove(bNodeTree *ntree, ReportList *reports, Poin
nodeFreeNode(ntree, node);
RNA_POINTER_INVALIDATE(node_ptr);
- ntreeUpdateTree(ntree); /* update group node socket links */
+ ntreeUpdateTree(G.main, ntree); /* update group node socket links */
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -786,7 +786,7 @@ static void rna_NodeTree_node_clear(bNodeTree *ntree, ReportList *reports)
node = next_node;
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -841,7 +841,7 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, ReportList *reports,
if (tonode)
nodeUpdate(ntree, tonode);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -863,7 +863,7 @@ static void rna_NodeTree_link_remove(bNodeTree *ntree, ReportList *reports, Poin
nodeRemLink(ntree, link);
RNA_POINTER_INVALIDATE(link_ptr);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -881,7 +881,7 @@ static void rna_NodeTree_link_clear(bNodeTree *ntree, ReportList *reports)
link = next_link;
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -969,7 +969,7 @@ static bNodeSocket *rna_NodeTree_inputs_new(bNodeTree *ntree, ReportList *report
sock = ntreeAddSocketInterface(ntree, SOCK_IN, type, name);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
return sock;
@@ -984,7 +984,7 @@ static bNodeSocket *rna_NodeTree_outputs_new(bNodeTree *ntree, ReportList *repor
sock = ntreeAddSocketInterface(ntree, SOCK_OUT, type, name);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
return sock;
@@ -1001,7 +1001,7 @@ static void rna_NodeTree_socket_remove(bNodeTree *ntree, ReportList *reports, bN
else {
ntreeRemoveSocketInterface(ntree, sock);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
}
@@ -1018,7 +1018,7 @@ static void rna_NodeTree_inputs_clear(bNodeTree *ntree, ReportList *reports)
ntreeRemoveSocketInterface(ntree, sock);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1034,14 +1034,14 @@ static void rna_NodeTree_outputs_clear(bNodeTree *ntree, ReportList *reports)
ntreeRemoveSocketInterface(ntree, sock);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C)
{
ntree->update |= NTREE_UPDATE_GROUP;
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
ED_node_tag_update_nodetree(CTX_data_main(C), ntree);
}
@@ -1543,7 +1543,7 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, ReportList *reports
BKE_report(reports, RPT_ERROR, "Unable to create socket");
}
else {
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1561,7 +1561,7 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, ReportList *report
BKE_reportf(reports, RPT_ERROR, "Unable to create socket");
}
else {
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1578,7 +1578,7 @@ static void rna_Node_socket_remove(ID *id, bNode *node, ReportList *reports, bNo
else {
nodeRemoveSocket(ntree, node, sock);
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
}
@@ -1593,7 +1593,7 @@ static void rna_Node_inputs_clear(ID *id, bNode *node)
nodeRemoveSocket(ntree, node, sock);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1607,7 +1607,7 @@ static void rna_Node_outputs_clear(ID *id, bNode *node)
nodeRemoveSocket(ntree, node, sock);
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1637,7 +1637,7 @@ static void rna_Node_inputs_move(ID *id, bNode *node, int from_index, int to_ind
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -1667,7 +1667,7 @@ static void rna_Node_outputs_move(ID *id, bNode *node, int from_index, int to_in
}
}
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
WM_main_add_notifier(NC_NODE | NA_EDITED, ntree);
}
@@ -2120,7 +2120,7 @@ static void rna_NodeSocketInterface_update(Main *bmain, Scene *UNUSED(scene), Po
return;
ntree->update |= NTREE_UPDATE_GROUP;
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
ED_node_tag_update_nodetree(bmain, ntree);
}
@@ -2246,7 +2246,7 @@ static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
bNode *node = (bNode *)ptr->data;
if (node->id)
- ntreeUpdateTree((bNodeTree *)node->id);
+ ntreeUpdateTree(bmain, (bNodeTree *)node->id);
ED_node_tag_update_nodetree(bmain, ntree);
}
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 62a937b106c..de81ea61baa 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -36,6 +36,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BKE_global.h"
#include "BKE_node.h"
#include "MEM_guardedalloc.h"
@@ -157,7 +158,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
int totnodes, n;
/* ensure all sock->link pointers and node levels are correct */
- ntreeUpdateTree(ntree);
+ ntreeUpdateTree(G.main, ntree);
/* get a dependency-sorted list of nodes */
ntreeGetDependencyList(ntree, &nodelist, &totnodes);