diff options
Diffstat (limited to 'source/blender/editors/object/object_select.c')
-rw-r--r-- | source/blender/editors/object/object_select.c | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 7a4db175ee4..ed53e4a9b91 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -144,13 +144,15 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->object->type == obtype) { ED_base_object_select(base, BA_SELECT); } @@ -218,7 +220,8 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; @@ -263,7 +266,8 @@ static int object_select_linked_exec(bContext *C, wmOperator *op) else return OPERATOR_CANCELLED; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (nr == 1) { // XXX old animation system //if (base->object->ipo==ipo) base->flag |= SELECT; @@ -386,7 +390,8 @@ static short select_grouped_children(bContext *C, Object *ob, int recursive) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (ob == base->object->parent) { if (!(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); @@ -444,7 +449,8 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in return 0; else if (group_count == 1) { group = ob_groups[0]; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!(base->flag & SELECT) && object_in_group(base->object, group)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -498,7 +504,8 @@ static short select_grouped_siblings(bContext *C, Object *ob) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->parent == ob->parent) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -512,7 +519,8 @@ static short select_grouped_type(bContext *C, Object *ob) { short changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->type == ob->type) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -526,7 +534,8 @@ static short select_grouped_layer(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->lay & ob->lay) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -540,7 +549,8 @@ static short select_grouped_index_object(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if ((base->object->index == ob->index) && !(base->flag & SELECT)) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -554,7 +564,8 @@ static short select_grouped_color(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (!(base->flag & SELECT) && (compare_v3v3(base->object->col, ob->col, 0.005f))) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -580,7 +591,8 @@ static short select_grouped_gameprops(bContext *C, Object *ob) { char changed = 0; - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { if (!(base->flag & SELECT) && (objects_share_gameprop(base->object, ob))) { ED_base_object_select(base, BA_SELECT); changed = 1; @@ -602,7 +614,8 @@ static short select_grouped_keyingset(bContext *C, Object *UNUSED(ob)) /* select each object that Keying Set refers to */ // TODO: perhaps to be more in line with the rest of these, we should only take objects // if the passed in object is included in this too - CTX_DATA_BEGIN (C, Base *, base, selectable_bases) { + CTX_DATA_BEGIN (C, Base *, base, selectable_bases) + { /* only check for this object if it isn't selected already, to limit time wasted */ if ((base->flag & SELECT) == 0) { KS_Path *ksp; @@ -635,7 +648,8 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); changed = 1; } @@ -700,13 +714,15 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op) layernum = RNA_int_get(op->ptr, "layers"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->lay == (1 << (layernum - 1))) ED_base_object_select(base, BA_SELECT); } @@ -749,7 +765,8 @@ static int object_select_all_exec(bContext *C, wmOperator *op) if (action == SEL_TOGGLE) { action = SEL_SELECT; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (base->flag & SELECT) { action = SEL_DESELECT; break; @@ -758,7 +775,8 @@ static int object_select_all_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { switch (action) { case SEL_SELECT: ED_base_object_select(base, BA_SELECT); @@ -821,7 +839,8 @@ static int object_select_same_group_exec(bContext *C, wmOperator *op) if (!group) return OPERATOR_PASS_THROUGH; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (!(base->flag & SELECT) && object_in_group(base->object, group)) ED_base_object_select(base, BA_SELECT); } @@ -858,7 +877,8 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); - CTX_DATA_BEGIN (C, Base *, primbase, selected_bases) { + CTX_DATA_BEGIN (C, Base *, primbase, selected_bases) + { char tmpname[MAXBONENAME]; flip_side_name(tmpname, primbase->object->id.name + 2, TRUE); @@ -914,14 +934,16 @@ static int object_select_random_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); if (extend == 0) { - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { ED_base_object_select(base, BA_DESELECT); } CTX_DATA_END; } percent = RNA_float_get(op->ptr, "percent") / 100.0f; - CTX_DATA_BEGIN (C, Base *, base, visible_bases) { + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { if (BLI_frand() < percent) { ED_base_object_select(base, BA_SELECT); } |