Merge with 2.5 -r 21756:22173.
[blender.git] / source / blender / blenkernel / intern / mesh.c
index 9fc8d0ed6091d0b9ceec89e3ebb06c7aecb2b61c..695bb6e3fa376fc0f1647e0b2e982d6ef14b0e1a 100644 (file)
@@ -796,6 +796,8 @@ void nurbs_to_mesh(Object *ob)
 
        dl= cu->disp.first;
        while(dl) {
+               int smooth= dl->rt & CU_SMOOTH ? 1 : 0;
+               
                if(dl->type==DL_SEGM) {
                        startvert= vertcount;
                        a= dl->parts*dl->nr;
@@ -812,6 +814,7 @@ void nurbs_to_mesh(Object *ob)
                                for(b=1; b<dl->nr; b++) {
                                        mface->v1= startvert+ofs+b-1;
                                        mface->v2= startvert+ofs+b;
+                                       if(smooth) mface->flag |= ME_SMOOTH;
                                        mface++;
                                }
                        }
@@ -836,6 +839,7 @@ void nurbs_to_mesh(Object *ob)
                                                mface->v1= startvert+ofs+b;
                                                if(b==dl->nr-1) mface->v2= startvert+ofs;
                                                else mface->v2= startvert+ofs+b+1;
+                                               if(smooth) mface->flag |= ME_SMOOTH;
                                                mface++;
                                        }
                                }
@@ -861,6 +865,7 @@ void nurbs_to_mesh(Object *ob)
                                mface->v4= 0;
                                test_index_face(mface, NULL, 0, 3);
                                
+                               if(smooth) mface->flag |= ME_SMOOTH;
                                mface++;
                                index+= 3;
                        }
@@ -908,6 +913,8 @@ void nurbs_to_mesh(Object *ob)
                                        mface->v4= p2;
                                        mface->mat_nr= (unsigned char)dl->col;
                                        test_index_face(mface, NULL, 0, 4);
+                                       
+                                       if(smooth) mface->flag |= ME_SMOOTH;
                                        mface++;
 
                                        p4= p3;