diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 16:40:37 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-11 16:40:37 +0300 |
commit | 78a8d3685bd3487eb0b5dd55793f94fe7235e377 (patch) | |
tree | 77f9ba0ddd9613eb7e9dbb8e0402f977548a281f /source/blender/nodes/composite | |
parent | b763c34e80d3b20f9a7f0a592e479e5fa7ab295f (diff) |
Cleanup: remove moar ugly G.main usages...
BKE_image was an ugly nest, could fix all but the ones from compositor,
so moved ugly G.main there, at least we know where the Evil is that way ;)
Diffstat (limited to 'source/blender/nodes/composite')
3 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index 4779fdd33d2..ab9d041198c 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -134,7 +134,7 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree) BKE_node_preview_sync_tree(ntree, localtree); } -static void local_merge(bNodeTree *localtree, bNodeTree *ntree) +static void local_merge(Main *bmain, bNodeTree *localtree, bNodeTree *ntree) { bNode *lnode; bNodeSocket *lsock; @@ -147,7 +147,7 @@ static void local_merge(bNodeTree *localtree, bNodeTree *ntree) if (ELEM(lnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) { if (lnode->id && (lnode->flag & NODE_DO_OUTPUT)) { /* image_merge does sanity check for pointers */ - BKE_image_merge((Image *)lnode->new_node->id, (Image *)lnode->id); + BKE_image_merge(bmain, (Image *)lnode->new_node->id, (Image *)lnode->id); } } else if (lnode->type == CMP_NODE_MOVIEDISTORTION) { diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c index dbe47066f66..f7008bc9ae4 100644 --- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.c +++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.c @@ -33,6 +33,7 @@ #include "node_composite_util.h" #include "BKE_image.h" +#include "BKE_global.h" /* **************** SPLIT VIEWER ******************** */ static bNodeSocketTemplate cmp_node_splitviewer_in[] = { @@ -50,7 +51,7 @@ static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node iuser->ok = 1; node->custom1 = 50; /* default 50% split */ - node->id = (ID *)BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); + node->id = (ID *)BKE_image_verify_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node"); } void register_node_type_cmp_splitviewer(void) diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.c b/source/blender/nodes/composite/nodes/node_composite_viewer.c index a10ba02b38e..f82b0d7206a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_viewer.c +++ b/source/blender/nodes/composite/nodes/node_composite_viewer.c @@ -33,6 +33,7 @@ #include "node_composite_util.h" #include "BKE_image.h" +#include "BKE_global.h" /* **************** VIEWER ******************** */ @@ -53,7 +54,7 @@ static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode *node) node->custom3 = 0.5f; node->custom4 = 0.5f; - node->id = (ID *)BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); + node->id = (ID *)BKE_image_verify_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node"); } void register_node_type_cmp_viewer(void) |