[finally! the commit went through]
authorJoseph Eagar <joeedh@gmail.com>
Thu, 22 Jul 2010 00:18:35 +0000 (00:18 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Thu, 22 Jul 2010 00:18:35 +0000 (00:18 +0000)
=bmesh=

First pass at post-merge stabilization.  Seems to work well enough now, but
I need to do more testing.  Also need to go through bmesh_class.h and make
sure the design/headers there make sense.

source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/bmesh/operators/createops.c
source/blender/bmesh/operators/mesh_conv.c
source/blender/bmesh/operators/subdivideop.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c
source/creator/CMakeLists.txt

index 0d4c51f3b89a428faeb7ab6b596694113e9a9f31..6eaac8525bc896d1bd5ca95310e7e998e20c70cc 100644 (file)
@@ -3064,6 +3064,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
 
        ccgdm->dm.getMinMax = cgdm_getMinMax;
        ccgdm->dm.getNumVerts = cgdm_getNumVerts;
+       ccgdm->dm.getNumEdges = cgdm_getNumEdges;
        ccgdm->dm.getNumTessFaces = cgdm_getNumTessFaces;
        ccgdm->dm.getNumFaces = cgdm_getNumTessFaces;
 
index df98229998a21ddd5721225305129ce3fcedbcc5..77c21cf2f3d0386a396450aa5746f4d7bd5cc624 100644 (file)
@@ -100,7 +100,7 @@ EPath *edge_path_new(PathBase *pb, BMVert *start)
 float edge_weight_path(EPath *path, EdgeData *edata)
 {
        EPathNode *node;
-       float w;
+       float w = 0.0;
 
        for (node=path->nodes.first; node; node=node->next) {
                if (node->e) {
index b34f5cc85c1f2dc30a13f24299091325a27bddf8..a45142a3c0b7bd40b338e1dc1f6acfa20c41ccf8 100644 (file)
@@ -312,6 +312,8 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) {
 
        numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
        numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
+       
+       ototvert = me->totvert;
 
        /* new Vertex block */
        if(bm->totvert==0) mvert= NULL;
index ca2f52085891401481b6d7053588c1a0f3ce90dd..e55b1071787ba126f816f484296610686ab4e77b 100644 (file)
@@ -934,10 +934,8 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op)
                                }
                        }
 
-                       i++;
                        continue;
                } else if (!pat) {
-                       i++;
                        continue;
                }
 
@@ -974,7 +972,7 @@ void esubdivide_exec(BMesh *bmesh, BMOperator *op)
        BLI_array_free(loops);
 
        BMO_Flag_To_Slot(bmesh, op, "outinner",
-                        ELE_INNER, BM_ALL);
+                        ELE_INNER, BM_ALL);    
        BMO_Flag_To_Slot(bmesh, op, "outsplit",
                         ELE_SPLIT, BM_ALL);
        
index 2d5323aa255014bd66ef50488925de042b111937..9a63bc3feeac5d5e7b3ed422026ee4798dd2519e 100644 (file)
@@ -668,31 +668,6 @@ static int mesh_extrude_region_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;       
 }
 
-static int mesh_extrude_region_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       Object *obedit= CTX_data_edit_object(C);
-       BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
-       float nor[3];
-       int constraint_axis[3] = {0, 0, 1};
-       int tmode;
-
-       tmode = EDBM_Extrude_edge(obedit, em, BM_SELECT, nor);
-
-       DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
-       RNA_enum_set(op->ptr, "proportional", 0);
-       RNA_boolean_set(op->ptr, "mirror", 0);
-
-       if (tmode == 'n') {
-               RNA_enum_set(op->ptr, "constraint_orientation", V3D_MANIP_NORMAL);
-               RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
-       }
-       WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_REGION_WIN, op->ptr);
-
-       return OPERATOR_FINISHED;
-}
-
 void MESH_OT_extrude_region(wmOperatorType *ot)
 {
        /* identifiers */
@@ -700,15 +675,13 @@ void MESH_OT_extrude_region(wmOperatorType *ot)
        ot->idname= "MESH_OT_extrude_region";
        
        /* api callbacks */
-       ot->invoke= mesh_extrude_region_invoke;
+       //ot->invoke= mesh_extrude_region_invoke;
        ot->exec= mesh_extrude_region_exec;
        ot->poll= ED_operator_editmesh;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-       /* to give to transform */
-       Transform_Properties(ot, P_PROPORTIONAL|P_CONSTRAINT|P_AXIS);
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }
 
@@ -725,31 +698,6 @@ static int mesh_extrude_verts_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;       
 }
 
-static int mesh_extrude_verts_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       Object *obedit= CTX_data_edit_object(C);
-       BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
-       float nor[3];
-       int constraint_axis[3] = {0, 0, 1};
-       int tmode;
-
-       tmode = EDBM_Extrude_verts_indiv(em, op, BM_SELECT, nor);
-
-       DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
-       RNA_enum_set(op->ptr, "proportional", 0);
-       RNA_boolean_set(op->ptr, "mirror", 0);
-
-       if (tmode == 'n') {
-               RNA_enum_set(op->ptr, "constraint_orientation", V3D_MANIP_NORMAL);
-               RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
-       }
-       WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_REGION_WIN, op->ptr);
-
-       return OPERATOR_FINISHED;
-}
-
 void MESH_OT_extrude_verts_indiv(wmOperatorType *ot)
 {
        /* identifiers */
@@ -757,7 +705,6 @@ void MESH_OT_extrude_verts_indiv(wmOperatorType *ot)
        ot->idname= "MESH_OT_extrude_verts_indiv";
        
        /* api callbacks */
-       ot->invoke= mesh_extrude_verts_invoke;
        ot->exec= mesh_extrude_verts_exec;
        ot->poll= ED_operator_editmesh;
        
@@ -765,7 +712,6 @@ void MESH_OT_extrude_verts_indiv(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
        /* to give to transform */
-       Transform_Properties(ot, P_PROPORTIONAL|P_CONSTRAINT|P_AXIS);
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }
 
@@ -782,30 +728,6 @@ static int mesh_extrude_edges_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;       
 }
 
-static int mesh_extrude_edges_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       Object *obedit= CTX_data_edit_object(C);
-       BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
-       float nor[3];
-       int tmode;
-
-       tmode = EDBM_Extrude_edges_indiv(em, op, BM_SELECT, nor);
-
-       DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
-       RNA_enum_set(op->ptr, "proportional", 0);
-       RNA_boolean_set(op->ptr, "mirror", 0);
-
-       /*if (tmode == 'n') {
-               RNA_enum_set(op->ptr, "constraint_orientation", V3D_MANIP_NORMAL);
-               RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
-       }*/
-       WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_REGION_WIN, op->ptr);
-
-       return OPERATOR_FINISHED;
-}
-
 void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
 {
        /* identifiers */
@@ -813,7 +735,6 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
        ot->idname= "MESH_OT_extrude_edges_indiv";
        
        /* api callbacks */
-       ot->invoke= mesh_extrude_edges_invoke;
        ot->exec= mesh_extrude_edges_exec;
        ot->poll= ED_operator_editmesh;
        
@@ -821,7 +742,6 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
        /* to give to transform */
-       Transform_Properties(ot, P_PROPORTIONAL|P_CONSTRAINT|P_AXIS);
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }
 
@@ -838,34 +758,6 @@ static int mesh_extrude_faces_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;       
 }
 
-static int mesh_extrude_faces_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       Object *obedit= CTX_data_edit_object(C);
-       BMEditMesh *em= ((Mesh*)obedit->data)->edit_btmesh;
-       float nor[3];
-       int constraint_axis[3] = {0, 0, 1};
-       int tmode;
-
-       tmode = EDBM_Extrude_face_indiv(em, op, BM_SELECT, nor);
-
-       DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
-       WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
-       RNA_enum_set(op->ptr, "proportional", 0);
-       RNA_boolean_set(op->ptr, "mirror", 0);
-       
-       if (tmode == 's') {
-               WM_operator_name_call(C, "TRANSFORM_OT_shrink_fatten", WM_OP_INVOKE_REGION_WIN, op->ptr);
-       } else {
-               if (tmode == 'n') {
-                       RNA_enum_set(op->ptr, "constraint_orientation", V3D_MANIP_NORMAL);
-                       RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
-               }
-               WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_REGION_WIN, op->ptr);
-       }
-       return OPERATOR_FINISHED;
-}
-
 void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
 {
        /* identifiers */
@@ -873,15 +765,12 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
        ot->idname= "MESH_OT_extrude_faces_indiv";
        
        /* api callbacks */
-       ot->invoke= mesh_extrude_faces_invoke;
        ot->exec= mesh_extrude_faces_exec;
        ot->poll= ED_operator_editmesh;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-       /* to give to transform */
-       Transform_Properties(ot, P_PROPORTIONAL|P_CONSTRAINT|P_AXIS);
        RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
 }
 
index 0dddcb578a1e00342b039e7e81a76ff1c6c03b1e..46980fdbd36330885100c451eed0b522651fafb4 100644 (file)
@@ -2226,6 +2226,8 @@ static void do_fill_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t
 static void do_scrape_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int totnode)
 {
        Brush *brush = paint_brush(&sd->paint);
+       rctf mr;
+       float xrad, yrad;
 
        float bstrength = ss->cache->bstrength;
        const float radius = ss->cache->radius;
index bc90ddb23b7a14516c37a8e2bf39a140d3eeffd9..00df7b57119466c87e4a90e4530ba05270c38d84 100644 (file)
@@ -289,9 +289,9 @@ GPUDrawObject *GPU_drawobject_new( DerivedMesh *dm )
        memset(numverts,0,sizeof(int)*32768);
 
        mvert = dm->getVertArray(dm);
-       mface = dm->getFaceArray(dm);
+       mface = dm->getTessFaceArray(dm);
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                if( mface[i].v4 )
                        numverts[mface[i].mat_nr+16383] += 6;   /* split every quad into two triangles */
@@ -861,9 +861,9 @@ void GPU_buffer_copy_vertex( DerivedMesh *dm, float *varray, int *index, int *re
        DEBUG_VBO("GPU_buffer_copy_vertex\n");
 
        mvert = dm->getVertArray(dm);
-       mface = dm->getFaceArray(dm);
+       mface = dm->getTessFaceArray(dm);
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
@@ -905,13 +905,13 @@ void GPU_buffer_copy_normal( DerivedMesh *dm, float *varray, int *index, int *re
        int start;
        float norm[3];
 
-       float *nors= dm->getFaceDataArray(dm, CD_NORMAL);
+       float *nors= dm->getTessFaceDataArray(dm, CD_NORMAL);
        MVert *mvert = dm->getVertArray(dm);
-       MFace *mface = dm->getFaceArray(dm);
+       MFace *mface = dm->getTessFaceArray(dm);
 
        DEBUG_VBO("GPU_buffer_copy_normal\n");
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
@@ -973,7 +973,7 @@ void GPU_buffer_copy_uv( DerivedMesh *dm, float *varray, int *index, int *redir,
 
        DEBUG_VBO("GPU_buffer_copy_uv\n");
 
-       mface = dm->getFaceArray(dm);
+       mface = dm->getTessFaceArray(dm);
        mtface = DM_get_face_data_layer(dm, CD_MTFACE);
 
        if( mtface == 0 ) {
@@ -981,7 +981,7 @@ void GPU_buffer_copy_uv( DerivedMesh *dm, float *varray, int *index, int *redir,
                return;
        }
                
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
@@ -1017,11 +1017,11 @@ void GPU_buffer_copy_color3( DerivedMesh *dm, float *varray_, int *index, int *r
        int i, numfaces;
        unsigned char *varray = (unsigned char *)varray_;
        unsigned char *mcol = (unsigned char *)user;
-       MFace *mface = dm->getFaceArray(dm);
+       MFace *mface = dm->getTessFaceArray(dm);
 
        DEBUG_VBO("GPU_buffer_copy_color3\n");
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                int start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
@@ -1047,11 +1047,11 @@ void GPU_buffer_copy_color4( DerivedMesh *dm, float *varray_, int *index, int *r
        int i, numfaces;
        unsigned char *varray = (unsigned char *)varray_;
        unsigned char *mcol = (unsigned char *)user;
-       MFace *mface = dm->getFaceArray(dm);
+       MFace *mface = dm->getTessFaceArray(dm);
 
        DEBUG_VBO("GPU_buffer_copy_color4\n");
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        for( i=0; i < numfaces; i++ ) {
                int start = index[redir[mface[i].mat_nr+16383]];
                if( mface[i].v4 )
@@ -1091,7 +1091,7 @@ GPUBuffer *GPU_buffer_color( DerivedMesh *dm )
                dm->drawObject->colType = CD_MCOL;
        }
 
-       numfaces= dm->getNumFaces(dm);
+       numfaces= dm->getNumTessFaces(dm);
        colors = MEM_mallocN(numfaces*12*sizeof(unsigned char), "GPU_buffer_color");
        for( i=0; i < numfaces*4; i++ ) {
                colors[i*3] = mcol[i].b;
@@ -1143,7 +1143,7 @@ void GPU_buffer_copy_uvedge( DerivedMesh *dm, float *varray, int *index, int *re
        if(tf) {
                for(i = 0; i < dm->numFaceData; i++, tf++) {
                        MFace mf;
-                       dm->getFace(dm,i,&mf);
+                       dm->getTessFace(dm,i,&mf);
 
                        VECCOPY2D(&varray[j],tf->uv[0]);
                        VECCOPY2D(&varray[j+2],tf->uv[1]);
index d96f70ed5e9f4a8502a8408be2851d8a047aeec7..33c4361a01e5314736085138a5175a7200c9d966 100644 (file)
@@ -1287,7 +1287,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4
                                glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, 180.0);
                }
 
-               power= (ELEM(la->type, LA_SUN, LA_HEMI))? la->energy*M_PI: la->power;
+               power= (ELEM(la->type, LA_SUN, LA_HEMI))? la->energy*M_PI: la->energy*M_PI; //XXX la->power
                
                /* setup energy */
                energy[0]= power*la->r;
index e4c662291ccd75e9df00a2ae2e7066c0b7e661d1..44ff8d12dfff6c81d11a1439a0a92846a1a35fa4 100644 (file)
@@ -1325,7 +1325,7 @@ static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *l
        lamp->mode = la->mode;
        lamp->type = la->type;
 
-       lamp->power= (ELEM(la->type, LA_SUN, LA_HEMI))? la->energy*M_PI: la->power;
+       lamp->power= (ELEM(la->type, LA_SUN, LA_HEMI))? la->energy*M_PI: la->energy*M_PI; //XXX la->power;
        if(lamp->mode & LA_NEG) lamp->power= -lamp->power;
 
        lamp->col[0]= la->r*lamp->power;
index f6eb274194586ffe5ca79da533280f67c4ddc608..a3977ffb16b6a461989e41e0d93eb9e26b7743ff 100644 (file)
@@ -411,13 +411,9 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
                bf_python 
                bf_gen_python 
                bf_ikplugin
-<<<<<<< .working
                bf_bmesh
-               bf_blenkernel
-=======
                bf_modifiers
                bf_blenkernel
->>>>>>> .merge-right.r30358
                bf_nodes
                bf_gpu
                bf_blenloader