Fix T45974: Bones fail to snap to verts

Was an issue with individual-origins + snap
This commit is contained in:
Campbell Barton 2015-09-02 01:34:03 +10:00
parent ef931fecc3
commit 312cb0a957
Notes: blender-bot 2023-02-14 08:42:47 +01:00
Referenced by issue #46325, bone rotation
Referenced by issue #45974, Bones snapping to verts
1 changed files with 7 additions and 1 deletions

View File

@ -1252,7 +1252,13 @@ static void createTransArmatureVerts(TransInfo *t)
else {
if (ebo->flag & BONE_TIPSEL) {
copy_v3_v3(td->iloc, ebo->tail);
copy_v3_v3(td->center, (t->around == V3D_LOCAL) ? ebo->head : td->iloc);
/* don't allow single selected tips to have a modified center,
* causes problem with snapping T45974 */
copy_v3_v3(td->center,
((t->around == V3D_LOCAL) &&
(ebo->flag & BONE_ROOTSEL)) ? ebo->head : td->iloc);
td->loc = ebo->tail;
td->flag = TD_SELECTED;
if (ebo->flag & BONE_EDITMODE_LOCKED)