svn merge ^/trunk/blender -r40370:40371
authorCampbell Barton <ideasman42@gmail.com>
Thu, 22 Sep 2011 16:30:33 +0000 (16:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 22 Sep 2011 16:30:33 +0000 (16:30 +0000)
1  2 
source/blender/editors/sculpt_paint/paint_vertex.c

index 901772247fe6d1518b1c9a5987efcf8974e41765,11a46bb373bcdc32a7e9e7b28581378a34be3b89..1c453e3dd1f786cef1d25f7ebaf6ece21ea6e976
@@@ -465,13 -391,10 +465,11 @@@ void vpaint_fill(Object *ob, unsigned i
  void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
  {
        Mesh *me;
 +      MFace *mface;
        MDeformWeight *dw, *uw;
        int *indexar;
-       int index, vgroup;
-       unsigned int faceverts[5]={0,0,0,0,0};
-       unsigned char i;
-       int vgroup_mirror= -1;
+       unsigned int index;
+       int vgroup, vgroup_mirror= -1;
        int selected;
        
        int use_vert_sel;
                                                continue;
                                        }
  
-                                       dw= defvert_verify_index(me->dvert+faceverts[i], vgroup);
+                                       dw= defvert_verify_index(&me->dvert[vidx], vgroup);
                                        if(dw) {
-                                               uw= defvert_verify_index(wp->wpaint_prev+faceverts[i], vgroup);
+                                               uw= defvert_verify_index(wp->wpaint_prev+vidx, vgroup);
                                                uw->weight= dw->weight; /* set the undo weight */
                                                dw->weight= paintweight;
-                                               
                                                if(me->editflag & ME_EDIT_MIRROR_X) {   /* x mirror painting */
 -                                                      int j= mesh_get_x_mirror_vert(ob, vidx);
 +                                                      int j= -1; //BMESH_TODO mesh_get_x_mirror_vert(ob, faceverts[i]);
                                                        if(j>=0) {
                                                                /* copy, not paint again */
                                                                if(vgroup_mirror != -1) {
@@@ -2184,16 -2105,16 +2188,16 @@@ static void wpaint_stroke_update_step(b
                paintweight/= (float)totw;
                        
        for(index=0; index<totindex; index++) {
 -                              
 -              if(indexar[index] && indexar[index]<=me->totface) {
 -                      MFace *mf= me->mface + (indexar[index]-1);
 -                      unsigned int fidx= mf->v4 ? 3:2;;
 -                      do {
 -                              unsigned int vidx= *(&mf->v1 + fidx);
 -
 -                              if(me->dvert[vidx].flag) {
 +              if(indexar[index] && indexar[index]<=me->totpoly) {
 +                      MPoly *mpoly= me->mpoly + (indexar[index]-1);
 +                      MLoop *ml=me->mloop+mpoly->loopstart;
 +                      int i;
 +
 +                      for (i=0; i<mpoly->totloop; i++, ml++) {
 +                              unsigned int vidx= ml->v;
 +                              if (me->dvert[vidx].flag) {
                                        alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*vidx, mval, pressure);
-                                       if(alpha != 0.0f) {
+                                       if(alpha) {
                                                do_weight_paint_vertex(wp, ob, &wpi, vidx, alpha, paintweight);
                                        }
                                        me->dvert[vidx].flag= 0;