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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-23 02:17:07 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-23 02:17:07 +0400
commit6bc2d572350c4bb86d81118813dd0fded7cd17e6 (patch)
tree2ef5263a732bff8d7c820bc9af42aa624941a7bc /source/blender/blenkernel
parent3f8a146a1e44e4903b0a99608106b5a911bd4166 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_image.h1
-rw-r--r--source/blender/blenkernel/intern/image.c13
-rw-r--r--source/blender/blenkernel/intern/scene.c13
3 files changed, 23 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 0f8e25b9df5..eefaac07b12 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -182,6 +182,7 @@ void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range);
void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path);
+void BKE_image_update_frame(const struct Main *bmain, int cfra);
/* sets index offset for multilayer files */
struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 64bc4928e35..919738afe7a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -3305,6 +3305,19 @@ void BKE_image_user_check_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
}
}
+/* goes over all ImageUsers, and sets frame numbers if auto-refresh is set */
+static void image_update_frame(struct Image *UNUSED(ima), struct ImageUser *iuser, void *customdata)
+{
+ int cfra = *(int *)customdata;
+
+ BKE_image_user_check_frame_calc(iuser, cfra, 0);
+}
+
+void BKE_image_update_frame(const Main *bmain, int cfra)
+{
+ BKE_image_walk_all_users(bmain, &cfra, image_update_frame);
+}
+
void BKE_image_user_file_path(ImageUser *iuser, Image *ima, char *filepath)
{
BLI_strncpy(filepath, ima->name, FILE_MAX);
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 */