Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / armature / armature_edit.c
index 6c8779202e9713785ef8dfee6201cd8e381ac0db..bb3c4164fc16fd216e0374f69e91f21face4dec7 100644 (file)
@@ -1458,8 +1458,9 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
                if (ebone->flag & BONE_DONE) {
                        copy_v3_v3(ebone->parent->tail, ebone->tail);
                        ebone->parent->rad_tail = ebone->rad_tail;
+                       SET_FLAG_FROM_TEST(ebone->parent->flag, ebone->flag & BONE_TIPSEL, BONE_TIPSEL);
 
-                       ED_armature_edit_bone_remove(arm, ebone);
+                       ED_armature_edit_bone_remove_ex(arm, ebone, false);
                        changed = true;
                }
        }
@@ -1468,10 +1469,9 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
                for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                        if (ebone->parent &&
                            ebone->parent->temp.ebone &&
-                           (ebone->flag & BONE_CONNECTED) == 0)
+                           (ebone->flag & BONE_CONNECTED))
                        {
-                               ebone->flag |= BONE_CONNECTED;
-                               ebone->rad_head = ebone->parent->rad_head;
+                               ebone->rad_head = ebone->parent->rad_tail;
                        }
                }