svn merge ^/trunk/blender -r42466:42495
authorCampbell Barton <ideasman42@gmail.com>
Wed, 7 Dec 2011 18:29:21 +0000 (18:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 7 Dec 2011 18:29:21 +0000 (18:29 +0000)
1  2 
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/windowmanager/intern/wm_gesture.c

index f9b07ed150e5d674c05625e69eef8a1081119f6f,1498a3b4cc08129844f2e0621a09d54ed773fcd5..64a802f225ff9bcb6d8c1a3e99cd0ccfbdf7e923
  #include "BKE_texture.h"
  #include "BKE_multires.h"
  #include "BKE_armature.h"
 +#include "BKE_particle.h"
 +#include "BKE_tessmesh.h"
 +#include "BKE_bvhutils.h"
+ #include "BKE_deform.h"
  
  #ifdef WITH_GAMEENGINE
  #include "BKE_navmesh_conversion.h"
index 149c73e29806e2899eaaa583b6ce03b3ae82a903,b809fd5dbb151698c070bbebd909907ee12d1f23..c08c4034cdb43124aec37961bbac1acad11a7f98
@@@ -1608,11 -1608,10 +1608,11 @@@ void ED_vgroup_mirror(Object *ob, cons
                          sel, sel_mirr,                                        \
                          flip_map, flip_map_len,                               \
                          mirror_weights, flip_vgroups,                         \
-                         all_vgroups, act_vgroup                               \
+                         all_vgroups, def_nr                                   \
                          )
  
 -      EditVert *eve, *eve_mirr;
 +      BMVert *eve, *eve_mirr;
 +
        MDeformVert *dvert, *dvert_mirr;
        short sel, sel_mirr;
        int     *flip_map, flip_map_len;
        /* only the active group */
        if(ob->type == OB_MESH) {
                Mesh *me= ob->data;
 -              EditMesh *em = BKE_mesh_get_editmesh(me);
 +              BMEditMesh *em = me->edit_btmesh;
  
                if (em) {
 -                      if(!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) {
 +                      BMIter iter;
 +
 +                      if(!CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT)) {
-                               MEM_freeN(flip_map);
-                               return;
+                               goto cleanup;
                        }
  
 -                      EM_cache_x_mirror_vert(ob, em);
 +                      EDBM_CacheMirrorVerts(em, FALSE);
  
                        /* Go through the list of editverts and assign them */
 -                      for(eve=em->verts.first; eve; eve=eve->next){
 -                              if((eve_mirr=eve->tmp.v)) {
 -                                      sel= eve->f & SELECT;
 -                                      sel_mirr= eve_mirr->f & SELECT;
 +                      BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
 +                              if((eve_mirr= EDBM_GetMirrorVert(em, eve))) {
 +                                      sel= BM_TestHFlag(eve, BM_SELECT);
 +                                      sel_mirr= BM_TestHFlag(eve_mirr, BM_SELECT);
  
                                        if((sel || sel_mirr) && (eve != eve_mirr)) {
 -                                              dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
 -                                              dvert_mirr= CustomData_em_get(&em->vdata, eve_mirr->data, CD_MDEFORMVERT);
 +                                              dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
 +                                              dvert_mirr= CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
                                                if(dvert && dvert_mirr) {
                                                        VGROUP_MIRR_OP;
                                                }
                                        }
  
 -                                      eve->tmp.v= eve_mirr->tmp.v= NULL;
 +                                      /* don't use these again */
 +                                      EDBM_ClearMirrorVert(em, eve);
 +                                      EDBM_ClearMirrorVert(em, eve_mirr);
                                }
                        }
 -                      BKE_mesh_end_editmesh(me, em);
 +                      EDBM_EndMirrorCache(em);
                }
                else {
                        /* object mode / weight paint */
index efa7837087a1821cccc0f20f0f895ad5a586f744,ecb54c77e0cdbbb163b51cc77bd76f55a3fdafec..cf61fe9281428cc9e019023cb70fbb21e919ed1a
@@@ -1057,8 -995,8 +1054,8 @@@ int minmax_verts(Object *obedit, float 
        copy_m3_m4(bmat, obedit->obmat);
        
        tv= transvmain;
-       for(a=0; a<tottrans; a++, tv++) {               
+       for(a=0; a<tottrans; a++, tv++) {
 -              copy_v3_v3(vec, tv->loc);
 +              copy_v3_v3(vec, tv->maploc);
                mul_m3_v3(bmat, vec);
                add_v3_v3(vec, obedit->obmat[3]);
                add_v3_v3(centroid, vec);