diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-27 20:45:00 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-27 20:45:00 +0400 |
commit | 6cadd2bee34fb276805086a7d82e2f0f7be7138d (patch) | |
tree | 2e6c58daaa386af7fa47a4293eba8f994a9d6704 /source/blender/blenkernel/intern/key.c | |
parent | 431619e45b75bbe4c9476dd944168fb8bea2e3ca (diff) |
Fix drivers and shape keys not handling subframes / frame mapping properly.
Change Scene.frame_set so that it ensures subframe in range [0,1[ as Blender
expects, otherwise some things like physics point cache lookups don't get
evaluated properly.
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 803b1e68915..cb0a11a16e0 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1065,7 +1065,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int if (key->slurph && key->type != KEY_RELATIVE) { const float ctime_scaled = key->ctime / 100.0f; float delta = (float)key->slurph / tot; - float cfra = (float)scene->r.cfra + scene->r.subframe; + float cfra = BKE_scene_frame_get(scene); int step, a; if (tot > 100 && slurph_opt) { @@ -1163,7 +1163,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in if (key->slurph && key->type != KEY_RELATIVE) { const float ctime_scaled = key->ctime / 100.0f; float delta = (float)key->slurph / tot; - float cfra = (float)scene->r.cfra + scene->r.subframe; + float cfra = BKE_scene_frame_get(scene); Nurb *nu; int i = 0, remain = 0; int step, a; @@ -1245,7 +1245,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int if (key->slurph && key->type != KEY_RELATIVE) { const float ctime_scaled = key->ctime / 100.0f; float delta = (float)key->slurph / tot; - float cfra = (float)scene->r.cfra + scene->r.subframe; + float cfra = BKE_scene_frame_get(scene); int a; for (a = 0; a < tot; a++, cfra += delta) { @@ -1360,7 +1360,7 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem) } else { /* do shapekey local drivers */ - float ctime = (float)scene->r.cfra + scene->r.subframe; + float ctime = BKE_scene_frame_get(scene); BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS); |