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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-01-13 17:02:23 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-01-13 17:02:23 +0400
commit08981f3a91a687efa8d28d308d6033e5a9e68b1f (patch)
tree2b8463b952428cea53a4e58060bd2ca2f40cadf3 /source/blender/blenkernel/intern/scene.c
parentb1bb7d2ee06d13e95154d13a6e830b8b0f845cde (diff)
Fix T37886: Material does no update when changing keyframes in dopesheet
It was a missing fcurve evaluation in scene update function which lead to materials only being updated on frame change. Added the same exception as we've got for the scene animation. It only runs when there're materials tagged for the update, so wouldn't expect speed regressions or so.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 1ef3d6cef30..984a99915da 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1538,6 +1538,25 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
if (adt && (adt->recalc & ADT_RECALC_ANIM))
BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, 0);
}
+
+ /* Extra call here to recalc aterial animation.
+ *
+ * Need to do this so changing material settings from the graph/dopesheet
+ * will update suff in the viewport.
+ */
+ if (DAG_id_type_tagged(bmain, ID_MA)) {
+ Material *material;
+ float ctime = BKE_scene_frame_get(scene);
+
+ for (material = bmain->mat.first;
+ material;
+ material = material->id.next)
+ {
+ AnimData *adt = BKE_animdata_from_id(&material->id);
+ if (adt && (adt->recalc & ADT_RECALC_ANIM))
+ BKE_animsys_evaluate_animdata(scene, &material->id, adt, ctime, 0);
+ }
+ }
/* notify editors and python about recalc */
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);