merge with 2.5 at r19462
authorJoseph Eagar <joeedh@gmail.com>
Mon, 30 Mar 2009 10:03:03 +0000 (10:03 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Mon, 30 Mar 2009 10:03:03 +0000 (10:03 +0000)
19 files changed:
1  2 
projectfiles_vc9/blender/blender.vcproj
projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc9/blender/editors/ED_editors.vcproj
projectfiles_vc9/blender/makesdna/DNA_makesdna.vcproj
source/blender/blenfont/intern/blf_internal.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/intern/arithb.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/intern/SConscript
tools/Blender.py

index 9d011cfbc3af7a3a2448bc44aae27bee7d7062c5,9d011cfbc3af7a3a2448bc44aae27bee7d7062c5..1b3d071b05aabc92e60a71a44697e18a999eaa03
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0" encoding="Windows-1252"?>\r
  <VisualStudioProject\r
        ProjectType="Visual C++"\r
--      Version="9,00"\r
++      Version="9.00"\r
        Name="BKE_blenkernel"\r
        ProjectGUID="{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}"\r
        RootNamespace="BKE_blenkernel"\r
index 81449aa489d8c36dab63e1e1f1a1662996b031ec,81449aa489d8c36dab63e1e1f1a1662996b031ec..96de023136387de0918b5f67c6443f03d667da33
@@@ -1,7 -1,7 +1,7 @@@
  <?xml version="1.0" encoding="Windows-1252"?>\r
  <VisualStudioProject\r
        ProjectType="Visual C++"\r
--      Version="9,00"\r
++      Version="9.00"\r
        Name="DNA_makesdna"\r
        ProjectGUID="{E013786A-9575-4F34-81B2-33290357EE87}"\r
        RootNamespace="DNA_makesdna"\r
                                RelativePath="..\..\..\source\blender\makesdna\DNA_mesh_types.h"\r
                                >\r
                        </File>\r
++                      <File\r
++                              RelativePath="..\..\..\source\blender\makesdna\DNA_meshdata_types.h"\r
++                              >\r
++                      </File>\r
                        <File\r
                                RelativePath="..\..\..\source\blender\makesdna\DNA_meta_types.h"\r
                                >\r
index 0000000000000000000000000000000000000000,f3a74db01985db6149f0c63c82b399f8de191dbb..d5ec20f790ae72ca69a5df1503a267862ba7e0fd
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,289 +1,290 @@@
 -              length += data->chars[c].advance;
+ /**
+  * $Id:
+  *
+  * ***** BEGIN GPL LICENSE BLOCK *****
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version. 
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+  *
+  * The Original Code is Copyright (C) 2009 Blender Foundation.
+  * All rights reserved.
+  *
+  * 
+  * Contributor(s): Blender Foundation
+  *
+  * ***** END GPL LICENSE BLOCK *****
+  */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #ifdef WITH_FREETYPE2
+ #include <ft2build.h>
+ #include FT_FREETYPE_H
+ #include FT_GLYPH_H
+ #endif /* WITH_FREETYPE2 */
+ #include "MEM_guardedalloc.h"
+ #include "DNA_listBase.h"
+ #include "DNA_vec_types.h"
+ #include "BKE_utildefines.h"
+ #include "BLI_blenlib.h"
+ #include "BLI_linklist.h"     /* linknode */
+ #include "BLI_string.h"
+ #include "BLI_arithb.h"
+ #include "BIF_gl.h"
+ #include "BLF_api.h"
+ #include "blf_internal_types.h"
+ #include "blf_internal.h"
+ #include "blf_font_helv10.h"
+ int blf_internal_get_texture(FontBLF *font)
+ {
+       FontDataBLF *data;
+       CharDataBLF *cd;
+       int width;
+       int height;
+       int c_rows, c_cols, c_width, c_height;
+       int i_width, i_height;
+       GLubyte *img, *img_row, *chr_row, *img_pxl;
+       int base_line, i, cell_x, cell_y, y, x;
+       int byte_idx, bit_idx;
+       data= (FontDataBLF *)font->engine;
+       if (data->texid != 0)
+               return(0);
+       width= data->xmax - data->xmin;
+       height= data->ymax - data->ymin;
+       c_rows= 16;
+       c_cols= 16;
+       c_width= 16;
+       c_height= 16;
+       i_width= c_cols * c_width;
+       i_height= c_rows * c_height;
+       base_line= -(data->ymin);
+       img= (GLubyte *)malloc(i_height * i_width);
+       memset((void *)img, 0, i_height * i_width);
+       if (width >= 16 || height >= 16) {
+               printf("Warning: Bad font size for: %s\n", font->name);
+               return(-1);
+       }
+       for (i= 0; i < 256; i++) {
+               cd= &data->chars[i];
+               if (cd->data_offset != -1) {
+                       cell_x= i%16;
+                       cell_y= i/16;
+                       for (y= 0; y < cd->height; y++) {
+                               img_row = &img[(cell_y*c_height + y + base_line - cd->yorig)*i_width];
+                               chr_row = &data->bitmap_data[cd->data_offset + ((cd->width+7)/8)*y];
+                               for (x= 0; x < cd->width; x++) {
+                                       img_pxl= &img_row[(cell_x*c_width + x - cd->xorig)];
+                                       byte_idx= x/8;
+                                       bit_idx= 7 - (x%8);
+                                       if (chr_row[byte_idx]&(1<<bit_idx)) {
+                                               img_pxl[0]= 255;
+                                       }
+                               }
+                       }
+               }
+       }
+       glGenTextures(1, &data->texid);
+       glBindTexture(GL_TEXTURE_2D, data->texid);
+       glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA4, i_width, i_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, img);
+       if (glGetError()) {
+               glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE4_ALPHA4, i_width, i_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, img);
+       }
+       
+       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       free((void *)img);
+       return(0);
+ }
+ void blf_internal_size(FontBLF *font, int size, int dpi)
+ {
+       return;
+ }
+ void blf_internal_draw(FontBLF *font, char *str)
+ {
+       FontDataBLF *data;
+       CharDataBLF *cd;
+       unsigned char c;
+       float pos, cell_x, cell_y, x, y, z;
+       int base_line;
+       GLint cur_tex;
+       data= (FontDataBLF *)font->engine;
+       base_line= -(data->ymin);
+       pos= 0;
+       x= 0.0f;
+       y= 0.0f;
+       z= 0.0f;
+       glGetIntegerv(GL_TEXTURE_2D_BINDING_EXT, &cur_tex);
+       if (cur_tex != data->texid)
+               glBindTexture(GL_TEXTURE_2D, data->texid);
+       glBegin(GL_QUADS);
+       while ((c= (unsigned char) *str++)) {
+               cd= &data->chars[c];
+               if (cd->data_offset != -1) {
+                       cell_x= (c%16)/16.0;
+                       cell_y= (c/16)/16.0;
+                       glTexCoord2f(cell_x + 1.0/16.0, cell_y);
+                       glVertex3f(x + pos + 16.0, -base_line + y + 0.0, z);
+                       glTexCoord2f(cell_x + 1.0/16.0, cell_y + 1.0/16.0);
+                       glVertex3f(x + pos + 16.0, -base_line + y + 16.0, z);
+                       glTexCoord2f(cell_x, cell_y + 1.0/16.0);
+                       glVertex3f(x + pos + 0.0, -base_line + y + 16.0, z);
+                       glTexCoord2f(cell_x, cell_y);
+                       glVertex3f(x + pos + 0.0, -base_line + y + 0.0, z);
+               }
+               
+               pos += cd->advance;
+       }
+       glEnd();
+ }
+ void blf_internal_boundbox(FontBLF *font, char *str, rctf *box)
+ {
+       FontDataBLF *data;
+       unsigned char c;
+       int length= 0;
+       int ascent= 0;
+       int descent= 0;
+       data= (FontDataBLF *)font->engine;
+       while ((c= (unsigned char) *str++)) {
+               int d = data->chars[c].yorig;
+               int a = data->chars[c].height - data->chars[c].yorig;
++
++              length += data->chars[c].advance;
+               if (a > ascent)
+                       ascent= a;
+               if (d > descent)
+                       descent= d;
+       }
+       box->xmin = (float)0;
+       box->ymin = (float)-descent;
+       box->xmax = (float)length;
+       box->ymax = (float)ascent;
+ }
+ float blf_internal_width(FontBLF *font, char *str)
+ {
+       FontDataBLF *data;
+       unsigned char c;
+       int length= 0;
+       data= (FontDataBLF *)font->engine;
+       while ((c= (unsigned char) *str++)) {
+               length += data->chars[c].advance;
+       }
+       return((float)(length * font->aspect));
+ }
+ float blf_internal_height(FontBLF *font, char *str)
+ {
+       FontDataBLF *data;
+       data= (FontDataBLF *)font->engine;
+       return(((float)(data->ymax - data->ymin)) * font->aspect);
+ }
+ void blf_internal_free(FontBLF *font)
+ {
+       MEM_freeN(font->name);
+       MEM_freeN(font);
+ }
+ FontBLF *blf_internal_new(char *name)
+ {
+       FontBLF *font;
+       font= (FontBLF *)MEM_mallocN(sizeof(FontBLF), "blf_internal_new");
+       font->name= BLI_strdup(name);
+       font->filename= NULL;
+       if (!strcmp(name, "helv10")) {
+               font->engine= (void *)&blf_font_helv10;
+               font->size= 10;
+       }
+       else
+               font->engine= NULL;
+       if (!font->engine) {
+               MEM_freeN(font->name);
+               MEM_freeN(font);
+               return(NULL);
+       }
+       font->type= BLF_FONT_INTERNAL;
+       font->ref= 1;
+       font->aspect= 1.0f;
+       font->pos[0]= 0.0f;
+       font->pos[1]= 0.0f;
+       font->angle= 0.0f;
+       Mat4One(font->mat);
+       font->clip_rec.xmin= 0.0f;
+       font->clip_rec.xmax= 0.0f;
+       font->clip_rec.ymin= 0.0f;
+       font->clip_rec.ymax= 0.0f;
+       font->flags= 0;
+       font->dpi= 72;
+       font->cache.first= NULL;
+       font->cache.last= NULL;
+       font->glyph_cache= NULL;
+       glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size);
+       font->size_set= blf_internal_size;
+       font->draw= blf_internal_draw;
+       font->boundbox_get= blf_internal_boundbox;
+       font->width_get= blf_internal_width;
+       font->height_get= blf_internal_height;
+       font->free= blf_internal_free;
+       if (blf_internal_get_texture(font) != 0) {
+               MEM_freeN(font->name);
+               MEM_freeN(font);
+               return(NULL);
+       }
+       return(font);
+ }
Simple merge
index 7afa5e1bceb647bb6f7b14616f6bcd5d033d2862,333c3a1f2c12e1c1452bd565a48001ba7dfbe35a..dcec73eebc2e19ccf86eb5c445dad5ba03c4d3d9
@@@ -782,13 -625,10 +782,13 @@@ static float bm_seg_intersect(BMEdge *e
  static int knife_cut_exec(bContext *C, wmOperator *op)
  {
        Object *obedit= CTX_data_edit_object(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh, *em2;
 -      EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data));
 +      BMesh *bm;
++      EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)), *em2;
        ARegion *ar= CTX_wm_region(C);
 -      EditEdge *eed;
 -      EditVert *eve;
 +      BMVert *bv;
 +      BMIter iter;
 +      BMEdge **edges = NULL, *be;
 +      BMOperator bmop;
        CutCurve curve[MAX_CUTS];
        struct GHash *gh;
        float isect=0.0;
        }
        RNA_END;
        
-       if(len<2) return OPERATOR_CANCELLED;
-       
+       if(len<2) {
+               EM_EndEditMesh(obedit->data, em);
+               return OPERATOR_CANCELLED;
+       }
 -      /*store percentage of edge cut for KNIFE_EXACT here.*/
 -      for(eed=em->edges.first; eed; eed= eed->next) 
 -              eed->tmp.fp = 0.0; 
 -      
 +      bm = editmesh_to_bmesh(em);
 +
        /*the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer*/
        gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp);
 -      for(eve=em->verts.first; eve; eve=eve->next){
 +      for(bv=BMIter_New(&iter, bm, BM_VERTS_OF_MESH, NULL);bv;bv=BMIter_Step(&iter)){
                scr = MEM_mallocN(sizeof(float)*2, "Vertex Screen Coordinates");
 -              VECCOPY(co, eve->co);
 +              VECCOPY(co, bv->co);
                co[3]= 1.0;
                Mat4MulVec4fl(obedit->obmat, co);
                project_float(ar, co, scr);
 -              BLI_ghash_insert(gh, eve, scr);
 -              eve->f1 = 0; /*store vertex intersection flag here*/
 -      
 +              BLI_ghash_insert(gh, bv, scr);
        }
        
 -      eed= em->edges.first;           
 -      while(eed) {    
 -              if( eed->v1->f & eed->v2->f & SELECT ){         // NOTE: uses vertex select, subdiv doesnt do edges yet
 -                      isect= seg_intersect(eed, curve, len, mode, gh);
 -                      if (isect!=0.0f) eed->f2= 1;
 -                      else eed->f2=0;
 -                      eed->tmp.fp= isect;
 -                      //printf("isect=%i\n", isect);
 -              }
 -              else {
 -                      eed->f2=0;
 -                      eed->f1=0;
 +      BMO_Init_Op(&bmop, "esubd");
 +      
 +      i = 0;
 +      /*store percentage of edge cut for KNIFE_EXACT here.*/
 +      for (be=BMIter_New(&iter, bm, BM_EDGES_OF_MESH, NULL); be; be=BMIter_Step(&iter)) {
 +              if( BM_Is_Selected(bm, be) ) {
 +                      isect= bm_seg_intersect(be, curve, len, mode, gh, &isected);
 +                      
 +                      if (isect != 0.0f) {
 +                              if (mode != KNIFE_MULTICUT) {
 +                                      BMO_Insert_MapFloat(bm, &bmop, 
 +                                             "edgepercents",
 +                                             be, isect);
 +
 +                              }
 +                              BMO_SetFlag(bm, be, 1);
 +                      }
                }
 -              eed= eed->next;
        }
        
 -      if (mode==KNIFE_MIDPOINT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, 1, SUBDIV_SELECT_ORIG);
 -      else if (mode==KNIFE_MULTICUT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, numcuts, SUBDIV_SELECT_ORIG);
 -      else esubdivideflag(obedit, em, SELECT, 0, B_KNIFE|B_PERCENTSUBD, 1, SUBDIV_SELECT_ORIG);
 +      BMO_Flag_To_Slot(bm, &bmop, "edges", 1, BM_EDGE);
  
 -      eed=em->edges.first;
 -      while(eed){
 -              eed->f2=0;
 -              eed->f1=0;
 -              eed=eed->next;
 -      }       
 +      BMO_Set_Int(&bmop, "numcuts", numcuts);
 +      flag = B_KNIFE;
 +      if (mode == KNIFE_MIDPOINT) numcuts = 1;
 +      BMO_Set_Int(&bmop, "flag", flag);
 +      BMO_Set_Float(&bmop, "radius", 0);
 +      
 +      BMO_Exec_Op(bm, &bmop);
 +      BMO_Finish_Op(bm, &bmop);
 +      
 +      V_FREE(edges);
 +      V_FREE(percents);
 +
 +      //if (mode==KNIFE_MIDPOINT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, 1, SUBDIV_SELECT_ORIG);
 +      //else if (mode==KNIFE_MULTICUT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, numcuts, SUBDIV_SELECT_ORIG);
 +      //else esubdivideflag(obedit, em, SELECT, 0, B_KNIFE|B_PERCENTSUBD, 1, SUBDIV_SELECT_ORIG);
        
        BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN);
 +
 +      free_editMesh(em);
 +
 +      em2 = bmesh_to_editmesh(bm);
 +      *em = *em2;
        
-       
 +      MEM_freeN(em2);
 +      BM_Free_Mesh(bm);
++
+       EM_EndEditMesh(obedit->data, em);
        return OPERATOR_FINISHED;
  }
  
index 68a6a48a0980936a852bcae967c58bf9c89c58d0,89e7fcbc775134bad9d120f2b327732c1f46a9dd..bfcbc01b8edd59283873d9a4a8e9a06040a1c91a
@@@ -1102,30 -1108,15 +1112,14 @@@ static void erase_vertices(EditMesh *em
        }
  }
  
- /* Note, these values must match delete_mesh() event values */
- static EnumPropertyItem prop_mesh_delete_types[] = {
-       {10,"VERT",             "Vertices", ""},
-       {1, "EDGE",             "Edges", ""},
-       {2, "FACE",             "Faces", ""},
-       {3, "ALL",              "All", ""},
-       {4, "EDGE_FACE","Edges & Faces", ""},
-       {5, "ONLY_FACE","Only Faces", ""},
-       {6, "EDGE_LOOP","Edge Loop", ""},
-       {7, "DISSOLVE","Dissolve Verts", ""},
-       {0, NULL, NULL, NULL}
- };
- static int delete_mesh_exec(bContext *C, wmOperator *op)
 -void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event)
++static int delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event)
  {
-       Object *obedit= CTX_data_edit_object(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
        EditFace *efa, *nextvl;
        EditVert *eve,*nextve;
        EditEdge *eed,*nexted;
        int count;
        char *str="Erase";
-       int event = RNA_enum_get(op->ptr, "type");
  
 -      
        if(event<1) return;
  
        if(event==10 ) {
  
        EM_fgon_flags(em);      // redo flags and indices for fgons
  
 -      delete_mesh(obedit,em, op,RNA_enum_get(op->ptr, "type"));
+ //    DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+ }
+ /* Note, these values must match delete_mesh() event values */
+ static EnumPropertyItem prop_mesh_delete_types[] = {
+       {10,"VERT",             "Vertices", ""},
+       {1, "EDGE",             "Edges", ""},
+       {2, "FACE",             "Faces", ""},
+       {3, "ALL",              "All", ""},
+       {4, "EDGE_FACE","Edges & Faces", ""},
+       {5, "ONLY_FACE","Only Faces", ""},
+       {6, "EDGE_LOOP","Edge Loop", ""},
++      {7, "DISSOLVE","Dissolve Verts", ""},
+       {0, NULL, NULL, NULL}
+ };
+ static int delete_mesh_exec(bContext *C, wmOperator *op)
+ {
+       Object *obedit= CTX_data_edit_object(C);
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
+       
++      delete_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type"));
+       
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
+       EM_EndEditMesh(obedit->data, em);
        return OPERATOR_FINISHED;
  }
  
@@@ -6437,9 -6469,9 +6471,9 @@@ static int subdivide_exec(bContext *C, 
  {
        Object *obedit= CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
        
 -      esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, 1, 0);
 +      BM_esubdivideflag_conv(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, 1, 0);
                
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
@@@ -6464,9 -6497,9 +6499,9 @@@ static int subdivide_multi_exec(bContex
  {
        Object *obedit= CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
        
 -      esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, RNA_int_get(op->ptr,"number_cuts"), 0);
 +      BM_esubdivideflag_conv(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, RNA_int_get(op->ptr,"number_cuts"), 0);
                
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
@@@ -6494,9 -6528,9 +6530,9 @@@ static int subdivide_multi_fractal_exec
  {
        Object *obedit= CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
  
 -      esubdivideflag(obedit, em, 1, -(RNA_float_get(op->ptr, "random_factor")/100), scene->toolsettings->editbutflag, RNA_int_get(op->ptr, "number_cuts"), 0);
 +      BM_esubdivideflag_conv(obedit, em, 1, -(RNA_float_get(op->ptr, "random_factor")/100), scene->toolsettings->editbutflag, RNA_int_get(op->ptr, "number_cuts"), 0);
                
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
@@@ -6525,9 -6560,9 +6562,9 @@@ static int subdivide_smooth_exec(bConte
  {
        Object *obedit= CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
  
 -      esubdivideflag(obedit, em, 1, 0.292f*RNA_float_get(op->ptr, "smoothness"), scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
 +      BM_esubdivideflag_conv(obedit, em, 1, 0.292f*RNA_float_get(op->ptr, "smoothness"), scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
                
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
@@@ -6919,11 -6957,9 +6959,11 @@@ void MESH_OT_beauty_fill(wmOperatorTyp
  static int convert_quads_to_tris_exec(bContext *C, wmOperator *op)
  {
        Object *obedit= CTX_data_edit_object(C);
-       EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+       EditMesh *em= EM_GetEditMesh((Mesh *)obedit->data);
        
 -      convert_to_triface(em,0);
 +      //convert_to_triface(em,0);
 +      if (!EDBM_CallOpf(em, op, "triangulate faces=%hf", BM_SELECT))
 +              return OPERATOR_CANCELLED;
        
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
index 1e07f5dff87e604bdde723979132f80974277b23,24e3a3cc4bff5e15fd9e35acae360e5b5cb7c19b..d618b524010dce63d620eef0b9545249f8250be1
@@@ -173,9 -144,8 +173,9 @@@ extern struct EditFace *EM_face_from_fa
  void MESH_OT_knife_cut(struct wmOperatorType *ot);
  
  /* ******************* editmesh_mods.c */
- void MESH_OT_loop_select(struct wmOperatorType *ot);
- void MESH_OT_de_select_all(struct wmOperatorType *ot);
+ void MESH_OT_select_loop(struct wmOperatorType *ot);
+ void MESH_OT_select_all_toggle(struct wmOperatorType *ot);
 +void MESH_OT_bmesh_test(struct wmOperatorType *ot);
  void MESH_OT_select_more(struct wmOperatorType *ot);
  void MESH_OT_select_less(struct wmOperatorType *ot);
  void MESH_OT_select_invert(struct wmOperatorType *ot);
@@@ -230,10 -200,10 +230,10 @@@ extern EditVert *findnearestvert(struc
  void join_triangles(EditMesh *em);
  int removedoublesflag(EditMesh *em, short flag, short automerge, float limit);                /* return amount */
  void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beauty, int numcuts, int seltype);
 -int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc);
 +int EdgeSlide(EditMesh *em, struct wmOperator *op, short immediate, float imperc);
  
- void MESH_OT_subdivs(struct wmOperatorType *ot);
  void MESH_OT_subdivide(struct wmOperatorType *ot);
+ void MESH_OT_subdivs(struct wmOperatorType *ot);
  void MESH_OT_subdivide_multi(struct wmOperatorType *ot);
  void MESH_OT_subdivide_multi_fractal(struct wmOperatorType *ot);
  void MESH_OT_subdivide_smooth(struct wmOperatorType *ot);
Simple merge