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:
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r--source/blender/editors/animation/anim_ops.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 8286e81b792..119df33dd91 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -62,7 +62,7 @@
/* Check if the operator can be run from the current context */
static int change_frame_poll(bContext *C)
{
- ScrArea *curarea= CTX_wm_area(C);
+ ScrArea *curarea = CTX_wm_area(C);
/* XXX temp? prevent changes during render */
if (G.rendering) return 0;
@@ -77,17 +77,17 @@ static int change_frame_poll(bContext *C)
/* Set the new frame number */
static void change_frame_apply(bContext *C, wmOperator *op)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
/* set the new frame number */
- CFRA= RNA_int_get(op->ptr, "frame");
+ CFRA = RNA_int_get(op->ptr, "frame");
FRAMENUMBER_MIN_CLAMP(CFRA);
SUBFRA = 0.f;
/* do updates */
sound_seek_scene(bmain, scene);
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
}
/* ---- */
@@ -105,14 +105,14 @@ static int change_frame_exec(bContext *C, wmOperator *op)
/* Get frame from mouse coordinates */
static int frame_from_event(bContext *C, wmEvent *event)
{
- ARegion *region= CTX_wm_region(C);
+ ARegion *region = CTX_wm_region(C);
float viewx;
/* convert from region coordinates to View2D 'tot' space */
UI_view2d_region_to_view(&region->v2d, event->mval[0], event->mval[1], &viewx, NULL);
/* round result to nearest int (frames are ints!) */
- return (int)floor(viewx+0.5f);
+ return (int)floor(viewx + 0.5f);
}
/* Modal Operator init */
@@ -150,7 +150,7 @@ 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)
+ if (event->val == KM_RELEASE)
return OPERATOR_FINISHED;
break;
}
@@ -172,7 +172,7 @@ static void ANIM_OT_change_frame(wmOperatorType *ot)
ot->poll = change_frame_poll;
/* flags */
- ot->flag = OPTYPE_BLOCKING|OPTYPE_UNDO;
+ ot->flag = OPTYPE_BLOCKING | OPTYPE_UNDO;
/* rna */
RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
@@ -182,14 +182,14 @@ static void ANIM_OT_change_frame(wmOperatorType *ot)
static int previewrange_define_exec(bContext *C, wmOperator *op)
{
- Scene *scene= CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
+ Scene *scene = CTX_data_scene(C);
+ ARegion *ar = CTX_wm_region(C);
float sfra, efra;
int xmin, xmax;
/* get min/max values from border select rect (already in region coordinates, not screen) */
- xmin= RNA_int_get(op->ptr, "xmin");
- xmax= RNA_int_get(op->ptr, "xmax");
+ xmin = RNA_int_get(op->ptr, "xmin");
+ xmax = RNA_int_get(op->ptr, "xmax");
/* convert min/max values to frames (i.e. region to 'tot' rect) */
UI_view2d_region_to_view(&ar->v2d, xmin, 0, &sfra, NULL);
@@ -201,14 +201,14 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
*/
FRAMENUMBER_MIN_CLAMP(sfra);
FRAMENUMBER_MIN_CLAMP(efra);
- if (efra < sfra) efra= sfra;
+ if (efra < sfra) efra = sfra;
scene->r.flag |= SCER_PRV_RANGE;
- scene->r.psfra= (int)floor(sfra + 0.5f);
- scene->r.pefra= (int)floor(efra + 0.5f);
+ scene->r.psfra = (int)floor(sfra + 0.5f);
+ scene->r.pefra = (int)floor(efra + 0.5f);
/* send notifiers */
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
return OPERATOR_FINISHED;
}
@@ -229,13 +229,13 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
ot->poll = ED_operator_animview_active;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
- /* used to define frame range */
+ /* used to define frame range */
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- /* these are not used, but are needed by borderselect gesture operator stuff */
+ /* these are not used, but are needed by borderselect gesture operator stuff */
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
}
@@ -244,8 +244,8 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
- Scene *scene= CTX_data_scene(C);
- ScrArea *curarea= CTX_wm_area(C);
+ Scene *scene = CTX_data_scene(C);
+ ScrArea *curarea = CTX_wm_area(C);
/* sanity checks */
if (ELEM(NULL, scene, curarea))
@@ -253,8 +253,8 @@ static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
/* simply clear values */
scene->r.flag &= ~SCER_PRV_RANGE;
- scene->r.psfra= 0;
- scene->r.pefra= 0;
+ scene->r.psfra = 0;
+ scene->r.pefra = 0;
ED_area_tag_redraw(curarea);
@@ -274,7 +274,7 @@ static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
ot->poll = ED_operator_animview_active;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ************************** registration **********************************/
@@ -319,7 +319,7 @@ void ED_keymap_anim(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* frame management */
- /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */
+ /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */
WM_keymap_add_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TKEY, KM_PRESS, KM_CTRL, 0);