svn merge ^/trunk/blender -r42009:42053
authorCampbell Barton <ideasman42@gmail.com>
Tue, 22 Nov 2011 11:51:42 +0000 (11:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 22 Nov 2011 11:51:42 +0000 (11:51 +0000)
18 files changed:
1  2 
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/intern/path_util.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_edit.c
source/blender/editors/render/render_shading.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_view3d/drawobject.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_ui_api.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/modifiers/intern/MOD_ocean.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c

@@@ -1477,18 -1238,15 +1477,15 @@@ static void ccgDM_drawEdges(DerivedMes
                        }
                }
        }
-       ccgFaceIterator_free(fi);
-       ccgEdgeIterator_free(ei);
  }
  static void ccgDM_drawLooseEdges(DerivedMesh *dm) {
 -      CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 -      CCGSubSurf *ss = ccgdm->ss;
 +      CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
 +      CCGSubSurf *ss = cgdm->ss;
-       CCGEdgeIterator *ei = ccgSubSurf_getEdgeIterator(ss);
-       int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
+       int totedge = ccgSubSurf_getNumEdges(ss);
+       int i, j, edgeSize = ccgSubSurf_getEdgeSize(ss);
  
-       for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
-               CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
+       for (j=0; j< totedge; j++) {
+               CCGEdge *e = ccgdm->edgeMap[j].edge;
                DMGridData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
  
                if (!ccgSubSurf_getEdgeNumFaces(e)) {
@@@ -1604,15 -1368,12 +1607,12 @@@ static void ccgDM_drawFacesSolid(Derive
  }
  
        /* Only used by non-editmesh types */
 -static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) {
 -      CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 -      CCGSubSurf *ss = ccgdm->ss;
 +static void cgdm_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) {
 +      CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
 +      CCGSubSurf *ss = cgdm->ss;
-       CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
        GPUVertexAttribs gattribs;
        DMVertexAttribs attribs= {{{NULL}}};
 -      /* MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */
 +      /* MTFace *tf = dm->getTessFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */
        int gridSize = ccgSubSurf_getGridSize(ss);
        int gridFaces = gridSize - 1;
        int edgeSize = ccgSubSurf_getEdgeSize(ss);
        }
  
  #undef PASSATTRIB
-       ccgFaceIterator_free(fi);
  }
  
 -static void ccgDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs)) {
 +static void cgdm_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs)) {
        dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
  }
  
        /* Only used by non-editmesh types */
 -static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *userData, int, void *attribs), int (*setFace)(void *userData, int index), void *userData) {
 +static void cgdm_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *userData, int, void *attribs), int (*setFace)(void *userData, int index), void *userData) {
        CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
        CCGSubSurf *ss = ccgdm->ss;
-       CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
        GPUVertexAttribs gattribs;
        DMVertexAttribs attribs= {{{NULL}}};
        int gridSize = ccgSubSurf_getGridSize(ss);
  }
  
  
 -static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsigned char *col1, unsigned char *col2) {
 -      CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 -      CCGSubSurf *ss = ccgdm->ss;
 +static void cgdm_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsigned char *col1, unsigned char *col2) {
 +      CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
 +      CCGSubSurf *ss = cgdm->ss;
-       CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
        int gridSize = ccgSubSurf_getGridSize(ss);
        unsigned char *cp1, *cp2;
-       int useTwoSide=1;
+       int useTwoSide=1, i, totface;
  
 -      ccgdm_pbvh_update(ccgdm);
 +      ccgdm_pbvh_update(cgdm);
  
        cp1= col1;
        if(col2) {
                }
        }
        glEnd();
-       ccgFaceIterator_free(fi);
  }
  
 -static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
 +static void cgdm_drawFacesTex_common(DerivedMesh *dm,
        int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
        int (*drawParamsMapped)(void *userData, int index),
        void *userData) 
@@@ -96,8 -94,9 +97,9 @@@ typedef struct tringselOpData 
        ViewContext vc;
  
        Object *ob;
 -      EditMesh *em;
 -      EditEdge *eed;
 +      BMEditMesh *em;
 +      BMEdge *eed;
+       NumInput num;
  
        int extend;
        int do_cut;
@@@ -365,9 -344,14 +367,14 @@@ static int ringsel_init (bContext *C, w
        lcd->ar= CTX_wm_region(C);
        lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW);
        lcd->ob = CTX_data_edit_object(C);
 -      lcd->em= BKE_mesh_get_editmesh((Mesh *)lcd->ob->data);
 +      lcd->em= ((Mesh *)lcd->ob->data)->edit_btmesh;
        lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend");
        lcd->do_cut = do_cut;
+       
+       initNumInput(&lcd->num);
+       lcd->num.idx_max = 0;
+       lcd->num.flag |= NUM_NO_NEGATIVE | NUM_NO_FRACTION;
+       
        em_setup_viewcontext(C, &lcd->vc);
  
        ED_region_tag_redraw(lcd->ar);
@@@ -455,27 -470,27 +462,29 @@@ static int loopcut_modal (bContext *C, 
                        
                        ED_region_tag_redraw(lcd->ar);
                        break;
 -              case WHEELUPMOUSE:  /* change number of cuts */
+               case PADPLUSKEY:
                case PAGEUPKEY:
 -                      if (event->val == KM_PRESS) {
 -                              cuts++;
 -                              RNA_int_set(op->ptr, "number_cuts",cuts);
 -                              ringsel_find_edge(lcd, cuts);
 -                              
 -                              ED_region_tag_redraw(lcd->ar);
 -                      }
 +              case WHEELUPMOUSE:  /* change number of cuts */
 +                      if (event->val == KM_RELEASE)
 +                              break;
 +
 +                      cuts++;
 +                      RNA_int_set(op->ptr,"number_cuts",cuts);
 +                      ringsel_find_edge(lcd, cuts);
 +                      
 +                      ED_region_tag_redraw(lcd->ar);
                        break;
 -              case WHEELDOWNMOUSE:  /* change number of cuts */
+               case PADMINUS:
                case PAGEDOWNKEY:
 -                      if (event->val == KM_PRESS) {
 -                              cuts=MAX2(cuts-1,1);
 -                              RNA_int_set(op->ptr,"number_cuts",cuts);
 -                              ringsel_find_edge(lcd, cuts);
 -                              
 -                              ED_region_tag_redraw(lcd->ar);
 -                      }
 +              case WHEELDOWNMOUSE:  /* change number of cuts */
 +                      if (event->val == KM_RELEASE)
 +                              break;
 +
 +                      cuts=MAX2(cuts-1,1);
 +                      RNA_int_set(op->ptr,"number_cuts",cuts);
 +                      ringsel_find_edge(lcd, cuts);
 +                      
 +                      ED_region_tag_redraw(lcd->ar);
                        break;
                case MOUSEMOVE: { /* mouse moved somewhere to select another loop */
                        int dist = 75;
@@@ -2819,34 -2735,29 +2819,28 @@@ static void draw_em_fancy(Scene *scene
        if(dt>OB_WIRE) {
                if(CHECK_OB_DRAWTEXTURE(v3d, dt)) {
                        if(draw_glsl_material(scene, ob, v3d, dt)) {
-                               /* if em has no faces the drawMappedFaces callback will fail */
-                               if(em->bm->totface) {
-                                       glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
+                               glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 -                              
 +
-                                       finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
-                                                                    draw_em_fancy__setGLSLFaceOpts, em);
-                                       GPU_disable_material();
+                               finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
 -                                                           draw_em_fancy__setGLSLFaceOpts, NULL);
++                                                           draw_em_fancy__setGLSLFaceOpts, em);
+                               GPU_disable_material();
 -                              
 +
-                                       glFrontFace(GL_CCW);
-                               }
+                               glFrontFace(GL_CCW);
                        }
                        else {
                                draw_mesh_textured(scene, v3d, rv3d, ob, finalDM, 0);
                        }
                }
                else {
-                       /* if em has no faces the drawMappedFaces callback will fail */
-                       if(em->bm->totface) {
-                               /* 3 floats for position, 3 for normal and times two because the faces may actually be quads instead of triangles */
-                               glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
+                       /* 3 floats for position, 3 for normal and times two because the faces may actually be quads instead of triangles */
+                       glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED);
 -                      
 +
-                               glEnable(GL_LIGHTING);
-                               glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
-                               finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, me->edit_btmesh, 0, GPU_enable_material, NULL);
+                       glEnable(GL_LIGHTING);
+                       glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 -                      
 -                      finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material, NULL);
 -                      
++                      finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, me->edit_btmesh, 0, GPU_enable_material, NULL);
 +
-                               glFrontFace(GL_CCW);
-                               glDisable(GL_LIGHTING);
-                       }
+                       glFrontFace(GL_CCW);
+                       glDisable(GL_LIGHTING);
                }
                        
                // Setup for drawing wire over, disable zbuffer
Simple merge
Simple merge