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:
authorCampbell Barton <ideasman42@gmail.com>2013-06-16 08:06:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-16 08:06:38 +0400
commit94cb20ff4e78bf733c1bf1a89134ad26f26f45aa (patch)
tree0bf20d18941d909eb1daf4b815ec69473ed9e717 /source/blender/makesrna
parentd63045d9777ed9677f6b851b7bbdb503d96731ee (diff)
when setting the subframe for large frames (250,000+) the precision was very poor.
now use double precision when combining the frame+subframe.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 1f4622ff7f4..375b31e0586 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -56,12 +56,11 @@
static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
{
- float cfra = (float)frame + subframe;
+ double cfra = (double)frame + (double)subframe;
+
+ CLAMP(cfra, MINAFRAME, MAXFRAME);
+ BKE_scene_frame_set(scene, cfra);
- scene->r.cfra = floorf(cfra);
- scene->r.subframe = cfra - floorf(cfra);
-
- CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1);
BKE_scene_camera_switch_update(scene);