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_nla/nla_select.c')
-rw-r--r--source/blender/editors/space_nla/nla_select.c60
1 files changed, 40 insertions, 20 deletions
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index c872ae3e182..cb54129a820 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -119,8 +119,9 @@ static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
}
}
- if (sel == SELECT_SUBTRACT)
+ if (sel == SELECT_SUBTRACT) {
break;
+ }
}
}
@@ -135,8 +136,9 @@ static void deselect_nla_strips(bAnimContext *ac, short test, short sel)
/* apply same selection to all strips */
for (strip = nlt->strips.first; strip; strip = strip->next) {
/* set selection */
- if (test != DESELECT_STRIPS_CLEARACTIVE)
+ if (test != DESELECT_STRIPS_CLEARACTIVE) {
ACHANNEL_SET_FLAG(strip, smode, NLASTRIP_FLAG_SELECT);
+ }
/* clear active flag */
/* TODO: for clear active,
@@ -156,8 +158,9 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
bAnimContext ac;
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* 'standard' behavior - check if selected, then apply relevant selection */
const int action = RNA_enum_get(op->ptr, "action");
@@ -284,8 +287,9 @@ static int nlaedit_box_select_exec(bContext *C, wmOperator *op)
short mode = 0;
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT;
@@ -305,13 +309,16 @@ static int nlaedit_box_select_exec(bContext *C, wmOperator *op)
* as frame-range one is often.
* Used for tweaking timing when "blocking", while channels is not that useful.
*/
- if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect))
+ if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect)) {
mode = NLA_BOXSEL_FRAMERANGE;
- else
+ }
+ else {
mode = NLA_BOXSEL_CHANNELS;
+ }
}
- else
+ else {
mode = NLA_BOXSEL_ALLSTRIPS;
+ }
/* apply box_select action */
box_select_nla_strips(&ac, rect, mode, selectmode);
@@ -373,8 +380,9 @@ static void nlaedit_select_leftright(bContext *C,
float xmin, xmax;
/* if currently in tweakmode, exit tweakmode first */
- if (scene->flag & SCE_NLA_EDIT_ON)
+ if (scene->flag & SCE_NLA_EDIT_ON) {
WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL);
+ }
/* if select mode is replace, deselect all keyframes (and channels) first */
if (select_mode == SELECT_REPLACE) {
@@ -428,18 +436,22 @@ static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op)
short selectmode;
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* select mode is either replace (deselect all, then add) or add/extend */
- if (RNA_boolean_get(op->ptr, "extend"))
+ if (RNA_boolean_get(op->ptr, "extend")) {
selectmode = SELECT_INVERT;
- else
+ }
+ else {
selectmode = SELECT_REPLACE;
+ }
/* if "test" mode is set, we don't have any info to set this with */
- if (leftright == NLAEDIT_LRSEL_TEST)
+ if (leftright == NLAEDIT_LRSEL_TEST) {
return OPERATOR_CANCELLED;
+ }
/* do the selecting now */
nlaedit_select_leftright(C, &ac, leftright, selectmode);
@@ -457,8 +469,9 @@ static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wm
short leftright = RNA_enum_get(op->ptr, "mode");
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* handle mode-based testing */
if (leftright == NLAEDIT_LRSEL_TEST) {
@@ -469,10 +482,12 @@ static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wm
/* determine which side of the current frame mouse is on */
x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
- if (x < CFRA)
+ if (x < CFRA) {
RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
- else
+ }
+ else {
RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_RIGHT);
+ }
}
/* perform selection */
@@ -562,8 +577,9 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s
/* loop over NLA-strips in this track,
* trying to find one which occurs in the necessary bounds */
for (strip = nlt->strips.first; strip; strip = strip->next) {
- if (BKE_nlastrip_within_bounds(strip, xmin, xmax))
+ if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) {
break;
+ }
}
}
@@ -578,8 +594,9 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s
/* if currently in tweakmode, exit tweakmode before changing selection states
* now that we've found our target...
*/
- if (scene->flag & SCE_NLA_EDIT_ON)
+ if (scene->flag & SCE_NLA_EDIT_ON) {
WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL);
+ }
/* for replacing selection, firstly need to clear existing selection */
if (select_mode == SELECT_REPLACE) {
@@ -636,8 +653,9 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent
short selectmode;
/* get editor data */
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
+ }
/* get useful pointers from animation context data */
/* scene= ac.scene; */ /* UNUSED */
@@ -645,10 +663,12 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent
// v2d= &ar->v2d;
/* select mode is either replace (deselect all, then add) or add/extend */
- if (RNA_boolean_get(op->ptr, "extend"))
+ if (RNA_boolean_get(op->ptr, "extend")) {
selectmode = SELECT_INVERT;
- else
+ }
+ else {
selectmode = SELECT_REPLACE;
+ }
/* select strips based upon mouse position */
mouse_nla_strips(C, &ac, event->mval, selectmode);