diff options
author | Matt Ebb <matt@mke3.net> | 2010-06-27 09:39:55 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-06-27 09:39:55 +0400 |
commit | 03fa4bb9992293b51eb7c24f2c1f810df634e632 (patch) | |
tree | 7dacebe843bf9c041b3ebb220665f428d58e2804 /source/blender/blenkernel/intern/scene.c | |
parent | ea4e5a08cdb782d314cee48dde5dff9331054fe3 (diff) |
Partial cleanup of timing system, with some guidance from Joshua:
* Fractional frames support has been changed to use a new var, scene->r.subframe.
This is a 0.0-1.0 float representing a subframe interval, used in generating a final float
frame number to evaluate animation system etc.
* Changed frame_to_float() and some instances of bsystem_time() into a convenience function:
float BKE_curframe(scene) which retrieves the floating point current frame, after subframe
and frame length corrections.
* Removed blur_offs and field_offs globals. These are now stored in render, used to
generate a scene->r.subframe before render database processing.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 719dc964b89..1bc690eb0ed 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -879,22 +879,16 @@ int scene_check_setscene(Scene *sce) return 1; } -/* This (evil) function is needed to cope with two legacy Blender rendering features -* mblur (motion blur that renders 'subframes' and blurs them together), and fields -* rendering. Thus, the use of ugly globals from object.c -*/ -// BAD... EVIL... JUJU...!!!! -// XXX moved here temporarily -float frame_to_float (Scene *scene, int cfra) /* see also bsystem_time in object.c */ +/* This function is needed to cope with fractional frames - including two Blender rendering features +* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */ + +/* see also bsystem_time in object.c */ +float BKE_curframe(Scene *scene) { - extern float bluroffs; /* bad stuff borrowed from object.c */ - extern float fieldoffs; - float ctime; - - ctime= (float)cfra; - ctime+= bluroffs+fieldoffs; - ctime*= scene->r.framelen; - + float ctime = scene->r.cfra; + ctime+= scene->r.subframe; + ctime*= scene->r.framelen; + return ctime; } @@ -929,7 +923,7 @@ void scene_update_tagged(Scene *scene) /* recalc scene animation data here (for sequencer) */ { - float ctime = frame_to_float(scene, scene->r.cfra); + float ctime = BKE_curframe(scene); AnimData *adt= BKE_animdata_from_id(&scene->id); if(adt && (adt->recalc & ADT_RECALC_ANIM)) @@ -946,7 +940,7 @@ void scene_update_tagged(Scene *scene) /* applies changes right away, does all sets too */ void scene_update_for_newframe(Scene *sce, unsigned int lay) { - float ctime = frame_to_float(sce, sce->r.cfra); + float ctime = BKE_curframe(sce); Scene *sce_iter; /* clear animation overrides */ |