fix [#26193] Weightpainting on Mesh with Armature-Modifier fails if x-mirror and...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 6 Oct 2011 04:06:47 +0000 (04:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 6 Oct 2011 04:06:47 +0000 (04:06 +0000)
source/blender/editors/sculpt_paint/paint_vertex.c

index f91d4a236992eb52eeef12910e9de7c8191bf12a..d724541943b01ea443cda10ca2da56ca35bb97db 100644 (file)
@@ -1618,9 +1618,14 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
                                /* copy, not paint again */
                                uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
                                uw->weight= dw->weight;
                                /* copy, not paint again */
                                uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
                                uw->weight= dw->weight;
-                               do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize);
                        }
                }
                        }
                }
+
+               /* important to normalize after mirror, otherwise mirror gets wight
+                * which has already been scaled down in relation to other weights,
+                * then scales a second time [#26193]. Tricky multi-paint code doesn't
+                * suffer from this problem - campbell */
+               do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize);
        }
        else {
                /* use locks and/or multipaint */
        }
        else {
                /* use locks and/or multipaint */