[Bf-blender-cvs] [0a8af46707a] master: Final cleanup of G.mains in render area.

Bastien Montagne noreply at git.blender.org
Tue Jun 19 19:25:25 CEST 2018


Commit: 0a8af46707a2a507524754e4195f2366169e9dca
Author: Bastien Montagne
Date:   Tue Jun 19 19:25:06 2018 +0200
Branches: master
https://developer.blender.org/rB0a8af46707a2a507524754e4195f2366169e9dca

Final cleanup of G.mains in render area.

===================================================================

M	source/blender/render/intern/source/external_engine.c
M	source/blender/render/intern/source/pipeline.c

===================================================================

diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index b99ab611458..765bb435525 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -790,8 +790,9 @@ void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, s
 	/* Register the pass in all scenes that have a render layer node for this layer.
 	 * Since multiple scenes can be used in the compositor, the code must loop over all scenes
 	 * and check whether their nodetree has a node that needs to be updated. */
-	Scene *sce;
-	for (sce = G.main->scene.first; sce; sce = sce->id.next) {
+	/* NOTE: using G_MAIN seems valid here,
+	 * unless we want to register that for every other temp Main we could generate??? */
+	for (Scene *sce = G_MAIN->scene.first; sce; sce = sce->id.next) {
 		if (sce->nodetree) {
 			ntreeCompositRegisterPass(sce->nodetree, scene, srl, name, type);
 		}
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 2c7ef8b606a..97971030dfb 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -198,7 +198,8 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs)
 	/* Flush stdout to be sure python callbacks are printing stuff after blender. */
 	fflush(stdout);
 
-	BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS);
+	/* NOTE: using G_MAIN seems valid here??? Not sure it's actually even used anyway, we could as well pass NULL? */
+	BLI_callback_exec(G_MAIN, NULL, BLI_CB_EVT_RENDER_STATS);
 
 	fputc('\n', stdout);
 	fflush(stdout);
@@ -3577,7 +3578,8 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie
 	/* Flush stdout to be sure python callbacks are printing stuff after blender. */
 	fflush(stdout);
 
-	BLI_callback_exec(re->main, NULL, BLI_CB_EVT_RENDER_STATS);
+	/* NOTE: using G_MAIN seems valid here??? Not sure it's actually even used anyway, we could as well pass NULL? */
+	BLI_callback_exec(G_MAIN, NULL, BLI_CB_EVT_RENDER_STATS);
 
 	BLI_timecode_string_from_time_simple(name, sizeof(name), re->i.lastframetime - render_time);
 	printf(" (Saving: %s)\n", name);



More information about the Bf-blender-cvs mailing list