svn merge -r37900:38000 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jul 2011 16:12:54 +0000 (16:12 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jul 2011 16:12:54 +0000 (16:12 +0000)
1  2 
source/blender/blenkernel/intern/key.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c
source/blender/modifiers/intern/MOD_displace.c
source/blender/render/intern/source/convertblender.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c

index a345cedec90524563804e803e9c3bd92f8a5c214,8b0cfb1d1563eeb9dad13082dd626f11f97b4f16..904f6af210518c5c12cae525441ce6166ab01d0f
  #include "BKE_key.h"
  #include "BKE_lattice.h"
  #include "BKE_library.h"
 +#include "BKE_tessmesh.h"
  #include "BKE_main.h"
  #include "BKE_object.h"
+ #include "BKE_deform.h"
  
  
  #include "RNA_access.h"
@@@ -1049,10 -1004,9 +1050,10 @@@ static void do_key(const int start, in
  static float *get_weights_array(Object *ob, char *vgroup)
  {
        MDeformVert *dvert= NULL;
 -      EditMesh *em= NULL;
 -      EditVert *eve;
 +      BMEditMesh *em= NULL;
 +      BMIter iter;
 +      BMVert *eve;
-       int totvert= 0, index= 0;
+       int totvert= 0, defgrp_index= 0;
        
        /* no vgroup string set? */
        if(vgroup[0]==0) return NULL;
                weights= MEM_callocN(totvert*sizeof(float), "weights");
  
                if(em) {
 -                      for(i=0, eve=em->verts.first; eve; eve=eve->next, i++) {
 -                              dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
 +                      eve = BMIter_New(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
 +                      for (i=0; eve; eve=BMIter_Step(&iter), i++) {
 +                              dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
  
                                if(dvert) {
-                                       for(j=0; j<dvert->totweight; j++) {
-                                               if(dvert->dw[j].def_nr == index) {
-                                                       weights[i]= dvert->dw[j].weight;
-                                                       break;
-                                               }
-                                       }
+                                       weights[i]= defvert_find_weight(dvert, defgrp_index);
                                }
                        }
                }
index 604a201816565bdb7ece57d4c7fb993860d660c6,4dc944db28c07d7eb8f34477f2387935bb17dd5e..01fab0813d4d3fc388a1b9fddefe63297bb6b864
@@@ -56,7 -56,7 +56,8 @@@
  #include "BKE_object.h"
  #include "BKE_report.h"
  #include "BKE_scene.h"
+ #include "BKE_deform.h"
 +#include "BKE_tessmesh.h"
  
  #include "RNA_define.h"
  #include "RNA_access.h"
@@@ -87,10 -86,10 +88,10 @@@ static int return_editmesh_indexar(BMEd
        *indexar= index= MEM_mallocN(4*totvert, "hook indexar");
        *tot= totvert;
        nr= 0;
-       cent[0]= cent[1]= cent[2]= 0.0;
+       zero_v3(cent);
        
 -      for(eve= em->verts.first; eve; eve= eve->next) {
 -              if(eve->f & SELECT) {
 +      BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
 +              if(BM_TestHFlag(eve, BM_SELECT)) {
                        *index= nr; index++;
                        add_v3_v3(cent, eve->co);
                }
        return totvert;
  }
  
 -static int return_editmesh_vgroup(Object *obedit, EditMesh *em, char *name, float *cent)
 +static int return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *name, float *cent)
  {
-       MDeformVert *dvert;
-       BMVert *eve;
-       BMIter iter;
-       int i, totvert=0;
-       
-       cent[0]= cent[1]= cent[2]= 0.0;
-       
+       zero_v3(cent);
        if(obedit->actdef) {
-               
+               const int defgrp_index= obedit->actdef-1;
 -              int i, totvert=0;
++              int totvert=0;
+               MDeformVert *dvert;
 -              EditVert *eve;
++              BMVert *eve;
++              BMIter iter;
                /* find the vertices */
 -              for(eve= em->verts.first; eve; eve= eve->next) {
 -                      dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
 +              BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
 +                      dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
  
                        if(dvert) {
-                               for(i=0; i<dvert->totweight; i++){
-                                       if(dvert->dw[i].def_nr == (obedit->actdef-1)) {
-                                               totvert++;
-                                               add_v3_v3(cent, eve->co);
-                                       }
+                               if(defvert_find_weight(dvert, defgrp_index) > 0.0f) {
+                                       add_v3_v3(cent, eve->co);
+                                       totvert++;
                                }
                        }
                }
Simple merge