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:
authorJoshua Leung <aligorith@gmail.com>2009-12-11 14:18:55 +0300
committerJoshua Leung <aligorith@gmail.com>2009-12-11 14:18:55 +0300
commitfba99b627b001177590e73471f0b0f29a832bc14 (patch)
tree48b8a7b369ad94c35c2d66f43873c9f369a3d21c /source/blender/editors/animation/anim_ops.c
parent7e7e1018acfb23f0e10d4ae051d002a6516b8d83 (diff)
Timeline Drawing Tweaks:
* Made the TimeLine current frame indicator get drawn using the standard frame-indicator code. Also, it is now possible to show the frame indicator box beside the line as in the other animation editors, although this is disabled in the timeline due to the closeness of the frame number field. * Removed some old (unnecessary) code -> "Continue Physics" option in TimeLine, which is now obsolete with the current physics options. Feel free to restore if this is not the case. -> Already commented out hacks to create "speed ipo" for curves. There are easy alternatives that are better integrated. -> Unused init/exit callbacks for scrubbing time, since those were only used to set an obsolete flag for timeline drawing that is now used for the indicator. * Switched long-keyframe optimisation code to use constants instead of some magic numbers + fancy trickery...
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r--source/blender/editors/animation/anim_ops.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 6c8a982b323..6aa638b1ada 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -74,25 +74,6 @@ static int change_frame_poll(bContext *C)
return ((curarea) && (curarea->spacetype != SPACE_IPO));
}
-/* Set any flags that are necessary to indicate modal time-changing operation */
-static int change_frame_init(bContext *C, wmOperator *op)
-{
- ScrArea *curarea= CTX_wm_area(C);
-
- if (curarea == NULL)
- return 0;
-
- if (curarea->spacetype == SPACE_TIME) {
- SpaceTime *stime= CTX_wm_space_time(C);
-
- /* timeline displays frame number only when dragging indicator */
- // XXX make this more in line with other anim editors?
- stime->flag |= TIME_CFRA_NUM;
- }
-
- return 1;
-}
-
/* Set the new frame number */
static void change_frame_apply(bContext *C, wmOperator *op)
{
@@ -106,33 +87,12 @@ static void change_frame_apply(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
}
-/* Clear any temp flags */
-static void change_frame_exit(bContext *C, wmOperator *op)
-{
- ScrArea *curarea= CTX_wm_area(C);
-
- if (curarea == NULL)
- return;
-
- if (curarea->spacetype == SPACE_TIME) {
- SpaceTime *stime= CTX_wm_space_time(C);
-
- /* timeline displays frame number only when dragging indicator */
- // XXX make this more in line with other anim editors?
- stime->flag &= ~TIME_CFRA_NUM;
- }
-}
-
/* ---- */
/* Non-modal callback for running operator without user input */
static int change_frame_exec(bContext *C, wmOperator *op)
{
- if (!change_frame_init(C, op))
- return OPERATOR_CANCELLED;
-
change_frame_apply(C, op);
- change_frame_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -166,7 +126,6 @@ static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event)
*/
RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
- change_frame_init(C, op);
change_frame_apply(C, op);
/* add temp handler */
@@ -175,20 +134,12 @@ static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
-/* In case modal operator is cancelled */
-static int change_frame_cancel(bContext *C, wmOperator *op)
-{
- change_frame_exit(C, op);
- return OPERATOR_CANCELLED;
-}
-
/* Modal event handling of frame changing */
static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
{
/* execute the events */
switch (event->type) {
case ESCKEY:
- change_frame_exit(C, op);
return OPERATOR_FINISHED;
case MOUSEMOVE:
@@ -201,10 +152,8 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
/* we check for either mouse-button to end, as checking for ACTIONMOUSE (which is used to init
* the modal op) doesn't work for some reason
*/
- if (event->val==KM_RELEASE) {
- change_frame_exit(C, op);
+ if (event->val==KM_RELEASE)
return OPERATOR_FINISHED;
- }
break;
}
@@ -221,7 +170,6 @@ void ANIM_OT_change_frame(wmOperatorType *ot)
/* api callbacks */
ot->exec= change_frame_exec;
ot->invoke= change_frame_invoke;
- ot->cancel= change_frame_cancel;
ot->modal= change_frame_modal;
ot->poll= change_frame_poll;