From 6bc2d572350c4bb86d81118813dd0fded7cd17e6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 22 May 2013 22:17:07 +0000 Subject: Fix #35449: image sequences to drive e.g. particle length or used in modifiers were no properly updating when rendering animations. The render engine was only updating the image user current frame on images used by material textures. Now moved the function that updates all from the editors to blenkernel level and do it on all frame changes. --- source/blender/blenkernel/intern/scene.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/scene.c') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index e93c32ddf64..76727987355 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -70,6 +70,7 @@ #include "BKE_global.h" #include "BKE_group.h" #include "BKE_idprop.h" +#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_mask.h" @@ -1236,6 +1237,14 @@ void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) { float ctime = BKE_scene_frame_get(sce); Scene *sce_iter; + + /* keep this first */ + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE); + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE); + + /* update animated image textures for particles, modifiers, gpu, etc, + * call this at the start so modifiers with textures don't lag 1 frame */ + BKE_image_update_frame(bmain, sce->r.cfra); /* rebuild rigid body worlds before doing the actual frame update * this needs to be done on start frame but animation playback usually starts one frame later @@ -1243,10 +1252,6 @@ void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) */ scene_rebuild_rbw_recursive(sce, ctime); - /* keep this first */ - BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE); - BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE); - sound_set_cfra(sce->r.cfra); /* clear animation overrides */ -- cgit v1.2.3