fix [#31048] converting curve object to mesh makes object disapper from 3D view
authorCampbell Barton <ideasman42@gmail.com>
Sat, 21 Apr 2012 13:08:26 +0000 (13:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 21 Apr 2012 13:08:26 +0000 (13:08 +0000)
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/mesh.c

index ee18c93b943d8b858eb486653d6177ec698b1e19..2dc95effdd73c855f96b1d3f8c4e20c2864aaa6f 100644 (file)
@@ -412,8 +412,9 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
                DEBUG_VBO( "Using legacy code. cdDM_drawEdges\n" );
                glBegin(GL_LINES);
                for (i = 0; i < dm->numEdgeData; i++, medge++) {
                DEBUG_VBO( "Using legacy code. cdDM_drawEdges\n" );
                glBegin(GL_LINES);
                for (i = 0; i < dm->numEdgeData; i++, medge++) {
-                       if ((drawAllEdges || (medge->flag&ME_EDGEDRAW))
-                          && (drawLooseEdges || !(medge->flag&ME_LOOSEEDGE))) {
+                       if ((drawAllEdges || (medge->flag & ME_EDGEDRAW)) &&
+                           (drawLooseEdges || !(medge->flag & ME_LOOSEEDGE)))
+                       {
                                glVertex3fv(mvert[medge->v1].co);
                                glVertex3fv(mvert[medge->v2].co);
                        }
                                glVertex3fv(mvert[medge->v1].co);
                                glVertex3fv(mvert[medge->v2].co);
                        }
index b7b9f6b21f44d2c1dc02b3bc2f0380c0eed2a523..b80b15e57f3b1cb19d1086a344423a15d9626ac3 100644 (file)
@@ -1224,7 +1224,10 @@ int nurbs_to_mdata(Object *ob, MVert **allvert, int *totvert,
        int *totloop, int *totpoly)
 {
        return nurbs_to_mdata_customdb(ob, &ob->disp,
        int *totloop, int *totpoly)
 {
        return nurbs_to_mdata_customdb(ob, &ob->disp,
-               allvert, totvert, alledge, totedge, allloop, allpoly, totloop, totpoly);
+                                      allvert, totvert,
+                                      alledge, totedge,
+                                      allloop, allpoly,
+                                      totloop, totpoly);
 }
 
 /* BMESH: this doesn't calculate all edges from polygons,
 }
 
 /* BMESH: this doesn't calculate all edges from polygons,
@@ -1232,9 +1235,11 @@ int nurbs_to_mdata(Object *ob, MVert **allvert, int *totvert,
 
 /* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
 /* use specified dispbase  */
 
 /* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
 /* use specified dispbase  */
-int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int *_totvert,
-       MEdge **alledge, int *_totedge, MLoop **allloop, MPoly **allpoly,
-       int *_totloop, int *_totpoly)
+int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase,
+                            MVert **allvert, int *_totvert,
+                            MEdge **alledge, int *_totedge,
+                            MLoop **allloop, MPoly **allpoly,
+                            int *_totloop, int *_totpoly)
 {
        DispList *dl;
        Curve *cu;
 {
        DispList *dl;
        Curve *cu;
@@ -1316,7 +1321,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int
                                for (b=1; b<dl->nr; b++) {
                                        medge->v1= startvert+ofs+b-1;
                                        medge->v2= startvert+ofs+b;
                                for (b=1; b<dl->nr; b++) {
                                        medge->v1= startvert+ofs+b-1;
                                        medge->v2= startvert+ofs+b;
-                                       medge->flag = ME_LOOSEEDGE|ME_EDGERENDER;
+                                       medge->flag = ME_LOOSEEDGE | ME_EDGERENDER | ME_EDGEDRAW;
 
                                        medge++;
                                }
 
                                        medge++;
                                }
@@ -1341,7 +1346,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int
                                                medge->v1= startvert+ofs+b;
                                                if (b==dl->nr-1) medge->v2= startvert+ofs;
                                                else medge->v2= startvert+ofs+b+1;
                                                medge->v1= startvert+ofs+b;
                                                if (b==dl->nr-1) medge->v2= startvert+ofs;
                                                else medge->v2= startvert+ofs+b+1;
-                                               medge->flag = ME_LOOSEEDGE|ME_EDGERENDER;
+                                               medge->flag = ME_LOOSEEDGE | ME_EDGERENDER | ME_EDGEDRAW;
                                                medge++;
                                        }
                                }
                                                medge++;
                                        }
                                }
@@ -1466,7 +1471,7 @@ void nurbs_to_mesh(Object *ob)
        cu= ob->data;
 
        if (dm == NULL) {
        cu= ob->data;
 
        if (dm == NULL) {
-               if (nurbs_to_mdata (ob, &allvert, &totvert, &alledge, &totedge, &allloop, &allpoly, &totloop, &totpoly) != 0) {
+               if (nurbs_to_mdata(ob, &allvert, &totvert, &alledge, &totedge, &allloop, &allpoly, &totloop, &totpoly) != 0) {
                        /* Error initializing */
                        return;
                }
                        /* Error initializing */
                        return;
                }