diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-22 18:41:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-22 18:41:37 +0300 |
commit | 18e2a5df1a1d0a279c39f09f00f2c3275748ce60 (patch) | |
tree | e181c410467c23e0102dd3fb45ccb410f9cec48c /source/blender/editors | |
parent | 47acd706fde992e1b4f940145724aae9bf896861 (diff) | |
parent | 69b327d8dcf91cccedf08b9a50c92d5b3922449b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_utils.c | 14 | ||||
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 6c8779202e9..bb3c4164fc1 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -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; } } diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 23a49d282e1..eaff0b10a02 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -134,7 +134,10 @@ void bone_free(bArmature *arm, EditBone *bone) BLI_freelinkN(arm->edbo, bone); } -void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) +/** + * \param clear_connected: When false caller is responsible for keeping the flag in a valid state. + */ +void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected) { EditBone *curBone; @@ -142,13 +145,20 @@ void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) for (curBone = arm->edbo->first; curBone; curBone = curBone->next) { if (curBone->parent == exBone) { curBone->parent = exBone->parent; - curBone->flag &= ~BONE_CONNECTED; + if (clear_connected) { + curBone->flag &= ~BONE_CONNECTED; + } } } bone_free(arm, exBone); } +void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone) +{ + ED_armature_edit_bone_remove_ex(arm, exBone, true); +} + bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child) { for (ebone_child = ebone_child->parent; ebone_child; ebone_child = ebone_child->parent) { diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 51d8f8edb44..a35380ca547 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -156,6 +156,8 @@ void ED_armature_validate_active(struct bArmature *arm); EditBone *ED_armature_edit_bone_add_primitive(struct Object *obedit_arm, float length, bool view_aligned); EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name); + +void ED_armature_edit_bone_remove_ex(struct bArmature *arm, EditBone *exBone, bool clear_connected); void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone); bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child); |