Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / armature / armature_select.c
index 65f845c..95acc8a 100644 (file)
@@ -149,10 +149,10 @@ void *get_bone_from_selectbuffer(
        short i;
        bool takeNext = false;
        int minsel = 0xffffffff, minunsel = 0xffffffff;
-       
+
        for (i = 0; i < hits; i++) {
                hitresult = buffer[3 + (i * 4)];
-               
+
                if (!(hitresult & BONESEL_NOSEL)) {
                        if (hitresult & BONESEL_ANY) {  /* to avoid including objects in selection */
                                Base *base = NULL;
@@ -184,7 +184,7 @@ void *get_bone_from_selectbuffer(
 
                                        data = ebone;
                                }
-                               
+
                                if (data) {
                                        if (sel) {
                                                if (do_nearest) {
@@ -225,7 +225,7 @@ void *get_bone_from_selectbuffer(
                        }
                }
        }
-       
+
        if (firstunSel) {
                *r_base = firstunSel_base;
                return firstunSel;
@@ -249,11 +249,11 @@ void *get_nearest_bone(
        short hits;
 
        ED_view3d_viewcontext_init(C, &vc);
-       
+
        // rect.xmin = ... mouseco!
        rect.xmin = rect.xmax = xy[0];
        rect.ymin = rect.ymax = xy[1];
-       
+
        hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect, VIEW3D_SELECT_PICK_NEAREST);
 
        *r_base = NULL;
@@ -310,7 +310,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEv
                                curBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
                        }
                }
-               
+
                if (curBone->flag & BONE_CONNECTED)
                        next = curBone->parent;
                else
@@ -339,11 +339,11 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEv
                if (!curBone)
                        bone = NULL;
        }
-       
+
        ED_armature_edit_sync_selection(arm->edbo);
-       
+
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, base->object);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -358,15 +358,15 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
        ot->name = "Select Connected";
        ot->idname = "ARMATURE_OT_select_linked";
        ot->description = "Select bones related to selected ones by parent/child relationships";
-       
+
        /* api callbacks */
        /* leave 'exec' unset */
        ot->invoke = armature_select_linked_invoke;
        ot->poll = armature_select_linked_poll;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        /* properties */
        RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend selection instead of deselecting everything first");
 }
@@ -505,7 +505,7 @@ cache_end:
                                                                dep = 1;
                                                        else if ( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL) == 0)
                                                                dep = 1;
-                                                       else 
+                                                       else
                                                                dep = 2;
                                                }
                                                else {
@@ -638,10 +638,10 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b
                        ED_armature_edit_deselect_all_multi(objects, objects_len);
                        MEM_freeN(objects);
                }
-               
+
                /* by definition the non-root connected bones have no root point drawn,
                 * so a root selection needs to be delivered to the parent tip */
-               
+
                if (selmask & BONE_SELECTED) {
                        if (nearBone->parent && (nearBone->flag & BONE_CONNECTED)) {
                                /* click in a chain */
@@ -706,9 +706,9 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b
                        else
                                nearBone->flag |= selmask;
                }
-               
+
                ED_armature_edit_sync_selection(arm->edbo);
-               
+
                if (nearBone) {
                        /* then now check for active status */
                        if (ebone_select_flag(nearBone)) {
@@ -748,7 +748,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
                }
                CTX_DATA_END;
        }
-       
+
        /*      Set the flags */
        CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones)
        {
@@ -783,7 +783,7 @@ static int armature_de_select_all_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, NULL);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -793,14 +793,14 @@ void ARMATURE_OT_select_all(wmOperatorType *ot)
        ot->name = "(De)select All";
        ot->idname = "ARMATURE_OT_select_all";
        ot->description = "Toggle selection status of all bones";
-       
+
        /* api callbacks */
        ot->exec = armature_de_select_all_exec;
        ot->poll = ED_operator_editarmature;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-       
+
        WM_operator_properties_select_all(ot);
 }
 
@@ -1228,7 +1228,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
        int direction = RNA_enum_get(op->ptr, "direction");
        const bool add_to_sel = RNA_boolean_get(op->ptr, "extend");
        bool changed = false;
-       
+
        ob = obedit;
        arm = (bArmature *)ob->data;
 
@@ -1286,15 +1286,15 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
                        changed = true;
                }
        }
-       
+
        if (changed == false) {
                return OPERATOR_CANCELLED;
        }
 
        ED_armature_edit_sync_selection(arm->edbo);
-       
+
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
-       
+
        return OPERATOR_FINISHED;
 }
 
@@ -1305,16 +1305,16 @@ void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
                {BONE_SELECT_CHILD, "CHILD", 0, "Select Child", ""},
                {0, NULL, 0, NULL, NULL}
        };
-       
+
        /* identifiers */
        ot->name = "Select Hierarchy";
        ot->idname = "ARMATURE_OT_select_hierarchy";
        ot->description = "Select immediate parent/children of selected bones";
-       
+
        /* api callbacks */
        ot->exec = armature_select_hierarchy_exec;
        ot->poll = ED_operator_editarmature;
-       
+
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;