Commit: f94f4e1d79f73e55ac215dd4cccc287c3611f68d
Author: Sybren A. Stüvel
Date:   Tue Sep 24 15:58:58 2019 +0200
Branches: master
https://developer.blender.org/rBf94f4e1d79f73e55ac215dd4cccc287c3611f68d

Fix T66555: Handler render init ignores output placeholders

Blender now calls render hooks before taking copy of `scene->r` in
`RE_RenderAnim()`.

A change to the render output filename made in the render-init hook
would not be picked up by by the copy. As a result, placeholders were
touched using the old name, whereas the rendered images would be saved
with the new filename.

Reviewers: sergey

Maniphest Tasks: T66555

Differential Revision: https://developer.blender.org/D5887

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

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

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

diff --git a/source/blender/render/intern/source/pipeline.c 
b/source/blender/render/intern/source/pipeline.c
index fdb90a6e91e..c3125cb72a1 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2506,6 +2506,10 @@ void RE_RenderAnim(Render *re,
                    int efra,
                    int tfra)
 {
+  /* Call hooks before taking a copy of scene->r, so user can alter the render 
settings prior to
+   * copying (e.g. alter the output path). */
+  render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_INIT);
+
   const RenderData rd = scene->r;
   bMovieHandle *mh = NULL;
   const int cfrao = rd.cfra;
@@ -2515,8 +2519,6 @@ void RE_RenderAnim(Render *re,
   const bool is_multiview_name = ((rd.scemode & R_MULTIVIEW) != 0 &&
                                   (rd.im_format.views_format == 
R_IMF_VIEWS_INDIVIDUAL));
 
-  render_callback_exec_id(re, re->main, &scene->id, BKE_CB_EVT_RENDER_INIT);
-
   /* do not fully call for each frame, it initializes & pops output window */
   if (!render_initialize_from_main(re, &rd, bmain, scene, single_layer, 
camera_override, 0, 1)) {
     return;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to