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:
authorMatt Ebb <matt@mke3.net>2010-06-27 09:39:55 +0400
committerMatt Ebb <matt@mke3.net>2010-06-27 09:39:55 +0400
commit03fa4bb9992293b51eb7c24f2c1f810df634e632 (patch)
tree7dacebe843bf9c041b3ebb220665f428d58e2804 /source/blender/editors
parentea4e5a08cdb782d314cee48dde5dff9331054fe3 (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/editors')
-rw-r--r--source/blender/editors/animation/anim_ops.c1
-rw-r--r--source/blender/editors/include/ED_keyframing.h2
-rw-r--r--source/blender/editors/screen/screen_ops.c1
-rw-r--r--source/blender/editors/space_action/action_edit.c1
-rw-r--r--source/blender/editors/space_graph/graph_edit.c1
-rw-r--r--source/blender/editors/space_graph/graph_ops.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
7 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 88d6051b23b..11ba3cfffed 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -69,6 +69,7 @@ static void change_frame_apply(bContext *C, wmOperator *op)
/* set the new frame number */
CFRA= RNA_int_get(op->ptr, "frame");
FRAMENUMBER_MIN_CLAMP(CFRA);
+ SUBFRA = 0.f;
/* do updates */
sound_seek_scene(C);
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 86a1f5c4031..fc5e3a43a62 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -257,7 +257,7 @@ short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter);
* Checks whether a keyframe exists for the given ID-block one the given frame.
* - It is recommended to call this method over the other keyframe-checkers directly,
* in case some detail of the implementation changes...
- * - frame: the value of this is quite often result of frame_to_float(CFRA)
+ * - frame: the value of this is quite often result of BKE_curframe()
*/
short id_frame_has_keyframe(struct ID *id, float frame, short filter);
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 515b06feba1..5aeb50b34c5 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1504,6 +1504,7 @@ static int frame_offset_exec(bContext *C, wmOperator *op)
delta = RNA_int_get(op->ptr, "delta");
CTX_data_scene(C)->r.cfra += delta;
+ CTX_data_scene(C)->r.subframe = 0.f;
sound_seek_scene(C);
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 01c8ede6a2a..0e2a7f690c5 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -1138,6 +1138,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op)
if (ked.i1) {
Scene *scene= ac.scene;
CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f);
+ SUBFRA= 0.f;
}
/* set notifier that things have changed */
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 6834dfac58a..a4a72ad2cd4 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1582,6 +1582,7 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op)
/* take the average values, rounding to the nearest int for the current frame */
CFRA= (int)floor((ked.f1 / ked.i1) + 0.5f);
+ SUBFRA= 0.f;
sipo->cursorVal= ked.f2 / (float)ked.i1;
}
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index c6d601f9305..fa9acb282c7 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -71,6 +71,7 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op)
* NOTE: sync this part of the code with ANIM_OT_change_frame
*/
CFRA= RNA_int_get(op->ptr, "frame");
+ SUBFRA=0.f;
sound_seek_scene(C);
/* set the cursor value */
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 96f1e058948..cfae9e7c4d5 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -820,7 +820,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
}
/* colour depends on whether there is a keyframe */
- if (id_frame_has_keyframe((ID *)ob, /*frame_to_float(scene, CFRA)*/(float)(CFRA), v3d->keyflags))
+ if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), v3d->keyflags))
UI_ThemeColor(TH_VERTEX_SELECT);
else
UI_ThemeColor(TH_TEXT_HI);