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/space_graph/graph_ops.c')
-rw-r--r--source/blender/editors/space_graph/graph_ops.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 30f3960e18a..79df4760939 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -64,8 +64,9 @@
static bool graphview_cursor_poll(bContext *C)
{
/* prevent changes during render */
- if (G.is_rendering)
+ if (G.is_rendering) {
return 0;
+ }
return ED_operator_graphedit_active(C);
}
@@ -132,8 +133,9 @@ static void graphview_cursor_setprops(bContext *C, wmOperator *op, const wmEvent
float viewx, viewy;
/* abort if not active region (should not really be possible) */
- if (ar == NULL)
+ if (ar == NULL) {
return;
+ }
/* convert from region coordinates to View2D 'tot' space */
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &viewx, &viewy);
@@ -157,8 +159,9 @@ static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *e
graphview_cursor_apply(C, op);
/* Signal that a scrubbing operating is starting */
- if (screen)
+ if (screen) {
screen->scrubbing = true;
+ }
/* add temp handler */
WM_event_add_modal_handler(C, op);
@@ -174,8 +177,9 @@ static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *ev
/* execute the events */
switch (event->type) {
case ESCKEY:
- if (screen)
+ if (screen) {
screen->scrubbing = false;
+ }
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
return OPERATOR_FINISHED;
@@ -191,8 +195,9 @@ static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *ev
case MIDDLEMOUSE:
/* We check for either mouse-button to end, to work with all user keymaps. */
if (event->val == KM_RELEASE) {
- if (screen)
+ if (screen) {
screen->scrubbing = false;
+ }
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
return OPERATOR_FINISHED;
@@ -236,8 +241,9 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
const bool unselected = RNA_boolean_get(op->ptr, "unselected");
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* get list of all channels that selection may need to be flushed to
* - hierarchy must not affect what we have access to here...
@@ -250,10 +256,12 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
* selected/unselected (depending on "unselected" prop)
*/
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
- if (unselected)
+ if (unselected) {
filter |= ANIMFILTER_UNSEL;
- else
+ }
+ else {
filter |= ANIMFILTER_SEL;
+ }
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
@@ -261,8 +269,9 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
/* hack: skip object channels for now, since flushing those will always flush everything,
* but they are always included */
/* TODO: find out why this is the case, and fix that */
- if (ale->type == ANIMTYPE_OBJECT)
+ if (ale->type == ANIMTYPE_OBJECT) {
continue;
+ }
/* change the hide setting, and unselect it... */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_CLEAR);
@@ -290,8 +299,9 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
* will always flush everything, but they are always included */
/* TODO: find out why this is the case, and fix that */
- if (ale->type == ANIMTYPE_OBJECT)
+ if (ale->type == ANIMTYPE_OBJECT) {
continue;
+ }
/* change the hide setting, and unselect it... */
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
@@ -341,8 +351,9 @@ static int graphview_curves_reveal_exec(bContext *C, wmOperator *op)
const bool select = RNA_boolean_get(op->ptr, "select");
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* get list of all channels that selection may need to be flushed to
* - hierarchy must not affect what we have access to here...
@@ -360,8 +371,9 @@ static int graphview_curves_reveal_exec(bContext *C, wmOperator *op)
/* hack: skip object channels for now, since flushing those will always flush everything,
* but they are always included. */
/* TODO: find out why this is the case, and fix that */
- if (ale->type == ANIMTYPE_OBJECT)
+ if (ale->type == ANIMTYPE_OBJECT) {
continue;
+ }
/* select if it is not visible */
if (ANIM_channel_setting_get(&ac, ale, ACHANNEL_SETTING_VISIBLE) == 0) {