Fix T37685: automatic weights affected by face masking outside weight paint mode.

Only when in weight paint mode should it check the selected vertices and faces,
in object mode it should just affect the entire mesh.
This commit is contained in:
Brecht Van Lommel 2014-01-23 17:47:20 +01:00
parent c37e8ecc50
commit 0847549009
Notes: blender-bot 2023-02-14 11:32:11 +01:00
Referenced by issue #37685, Automatic Weighting of Armature Fails Unless Normals Recalculated
1 changed files with 3 additions and 2 deletions

View File

@ -668,8 +668,9 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
return;
/* count triangles and create mask */
if ((use_face_sel = ((me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0)) ||
(use_vert_sel = ((me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0)))
if (ob->mode == OB_MODE_WEIGHT_PAINT &&
((use_face_sel = ((me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0)) ||
(use_vert_sel = ((me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0))))
{
mask = MEM_callocN(sizeof(int) * me->totvert, "heat_bone_weighting mask");