svn merge ^/trunk/blender -r42778:42839
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Dec 2011 08:41:53 +0000 (08:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Dec 2011 08:41:53 +0000 (08:41 +0000)
28 files changed:
1  2 
intern/cycles/blender/blender_mesh.cpp
release/scripts/startup/bl_operators/uvcalc_smart_project.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/CMakeLists.txt
source/blender/blenloader/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap.c
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_weightvgproximity.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/strand.c
source/creator/CMakeLists.txt
source/gameengine/Converter/BL_BlenderDataConversion.cpp

index 4a78d8fc9beb32313271c4e36b446443951fd477,b79fc0c01b322722fdc3a31e5b97c483045bab54..8fee21cdad5863bd4692a1f992b10d0c90ffb8a2
@@@ -756,10 -756,13 +756,10 @@@ def VectoQuat(vec)
  
  
  class thickface(object):
-     __slots__= ('v', 'uv', 'no', 'area', 'edge_keys')
+     __slost__= "v", "uv", "no", "area", "edge_keys"
 -    def __init__(self, face, uvface, mesh_verts):
 +    def __init__(self, face, uv_layer, mesh_verts):
          self.v = [mesh_verts[i] for i in face.vertices]
 -        if len(self.v)==4:
 -            self.uv = uvface.uv1, uvface.uv2, uvface.uv3, uvface.uv4
 -        else:
 -            self.uv = uvface.uv1, uvface.uv2, uvface.uv3
 +        self.uv = [uv_layer[i].uv for i in face.loops]
  
          self.no = face.normal
          self.area = face.area
Simple merge
index 57075ac3bcf4393ce6040065942d7f053ecfb6e5,0333eab7e1ffa7e71b5b4e9cd4e120c95b0ddd19..20b560744b3aa5b21dc7838f87d0eb0f6f09446e
@@@ -5,7 -5,7 +5,7 @@@ sources = env.Glob('intern/*.c'
  
  incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
  incs += ' ../makesdna ../editors/include'
- incs += ' ../render/extern/include ../makesrna ../nodes ../bmesh'
 -incs += ' ../render/extern/include ../makesrna ../nodes ../imbuf'
++incs += ' ../render/extern/include ../makesrna ../nodes ../bmesh ../imbuf'
  
  incs += ' ' + env['BF_ZLIB_INC']
  
index 851d6c1174a959b5d84fceb5a7138762a8deafd0,e40fe6176a390bd8f0dfc1e85fd44a710c931325..ea3fe09ff6986cb04500689dfcffc7abc69513d0
@@@ -2685,11 -2626,13 +2685,10 @@@ static void draw_em_fancy_edges(BMEditM
        }
  }     
  
- static void draw_em_measure_stats(View3D *v3d, RegionView3D *rv3d,
-                                   Object *ob, BMEditMesh *em, UnitSettings *unit)
 -static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSettings *unit)
++static void draw_em_measure_stats(View3D *v3d, Object *ob, BMEditMesh *em, UnitSettings *unit)
  {
        Mesh *me= ob->data;
 -      EditEdge *eed;
 -      EditFace *efa;
 -      float v1[3], v2[3], v3[3], v4[3], vmid[3];
 -      float fvec[3];
 +      float v1[3], v2[3], v3[3], vmid[3], fvec[3];
        char val[32]; /* Stores the measurement display text here */
        const char *conv_float; /* Use a float conversion matching the grid size */
        unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */
        else if (grid < 1.0f)   conv_float= "%.4g";
        else if (grid < 10.0f)  conv_float= "%.3g";
        else                                    conv_float= "%.2g";
-       if(v3d->zbuf && (v3d->flag & V3D_ZBUF_SELECT)==0)
-               glDisable(GL_DEPTH_TEST);
-       if(v3d->zbuf) bglPolygonOffset(rv3d->dist, 5.0f);
        
        if(me->drawflag & ME_DRAWEXTRA_EDGELEN) {
 +              BMEdge *eed;
 +
                UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
  
 -              for(eed= em->edges.first; eed; eed= eed->next) {
 -                      /* draw non fgon edges, or selected edges, or edges next to selected verts while draging */
 -                      if((eed->h != EM_FGON) && ((eed->f & SELECT) || (do_moving && ((eed->v1->f & SELECT) || (eed->v2->f & SELECT)) ))) {
 +              eed = BMIter_New(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
 +              for(; eed; eed=BMIter_Step(&iter)) {
 +                      /* draw selected edges, or edges next to selected verts while draging */
 +                      if(BM_TestHFlag(eed, BM_SELECT) ||
 +                              (do_moving && (BM_TestHFlag(eed->v1, BM_SELECT) || BM_TestHFlag(eed->v2, BM_SELECT) ))) {
 +
                                copy_v3_v3(v1, eed->v1->co);
                                copy_v3_v3(v2, eed->v2->co);
  
                        }
                }
        }
+ }
  
-       /* useful for debugging index vs shape key index */
- #if 0
-       {
-               BMIter iter;
-               BMVert *eve;
-               int j=0;
 -static void draw_em_indices(EditMesh *em)
++static void draw_em_indices(BMEditMesh *em)
+ {
 -      EditEdge *e;
 -      EditFace *f;
 -      EditVert *v;
++      BMEdge *e;
++      BMFace *f;
++      BMVert *v;
+       int i;
+       char val[32];
+       float pos[3];
+       unsigned char col[4];
  
-               UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
 -      /* For now, reuse appropriate theme colors from stats text colors */
++      BMIter iter;
++      BMesh *bm= em->bm;
  
-               if(CustomData_has_layer(&em->bm->vdata, CD_SHAPE_KEYINDEX)) {
-                       int *keyi;
-                       BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               keyi = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
-                               if(keyi && *keyi != ORIGINDEX_NONE) {
-                                       sprintf(val, "%d:%d", j, *keyi);
-                               }
-                               else {
-                                       sprintf(val, "%d", j);
-                               }
-                               view3d_cached_text_draw_add(eve->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
-                               i++;
-                       }
++      /* For now, reuse appropriate theme colors from stats text colors */
++      i= 0;
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
 -      for (v = em->verts.first, i = 0; v; v = v->next, i++) {
 -              if (v->f & SELECT) {
++      BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
++              if (BM_TestHFlag(v, BM_SELECT)) {
+                       sprintf(val, "%d", i);
+                       view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
                }
-               else {
-                       BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
-                               sprintf(val, "%d", j);
-                               view3d_cached_text_draw_add(eve->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
-                               j++;
-                       }
++              i++;
+       }
++      i= 0;
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
 -      for (e = em->edges.first, i = 0; e; e = e->next, i++) {
 -              if (e->f & SELECT) {
++      BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
++              if (BM_TestHFlag(e, BM_SELECT)) {
+                       sprintf(val, "%d", i);
+                       mid_v3_v3v3(pos, e->v1->co, e->v2->co);
+                       view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
                }
++              i++;
        }
- #endif
  
-       if(v3d->zbuf) {
-               glEnable(GL_DEPTH_TEST);
-               bglPolygonOffset(rv3d->dist, 0.0f);
++      i= 0;
+       UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
 -      for (f = em->faces.first, i = 0; f; f = f->next, i++) {
 -              if (f->f & SELECT) {
++      BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
++              if (BM_TestHFlag(f, BM_SELECT)) {
++                      BM_Compute_Face_CenterMean(bm, f, pos);
+                       sprintf(val, "%d", i);
 -                      view3d_cached_text_draw_add(f->cent, val, 0, V3D_CACHE_TEXT_ASCII, col);
++                      view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
+               }
++              i++;
        }
  }
  
index 1330c57974ded6e2f63b7db57ac3b7b3444329fd,f6e958ab1f5b81df037d58490dc114528788f694..846fb751d7a7bb2c0c3b06bce67ce3123aa3d268
@@@ -2534,9 -2128,15 +2534,14 @@@ static void rna_def_mesh(BlenderRNA *br
        
        prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEAREA);
 -      RNA_def_property_ui_text(prop, "Face Area",
 -                               "Display the area of selected faces, using global values when set in the transform panel");
 +      RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces, Using global values when set in the transform panel");
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
  
+       prop= RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_INDICES);
+       RNA_def_property_ui_text(prop, "Indices", "Displays the index numbers of selected vertices, edges, and faces");
+       RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
        /* editflag */
        prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
Simple merge