svn merge -r39286:39385 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / modifiers / intern / MOD_screw.c
index c5fdf465a0aff7b9d29baaa19bc6ae2bc5b9ffbc..bbc17447b1c8fa163cf59601e5aa10468f89be0b 100644 (file)
@@ -176,7 +176,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
 
        /* dont do anything? */
        if (!totvert)
-               return CDDM_from_template(dm, 0, 0, 0);
+               return CDDM_from_template(dm, 0, 0, 0, 0, 0);
 
        switch(ltmd->axis) {
        case 0:
@@ -294,17 +294,17 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                maxFaces =      totedge * (step_tot-1);
        }
        
-       result= CDDM_from_template(dm, maxVerts, maxEdges, maxFaces);
+       result= CDDM_from_template(dm, maxVerts, maxEdges, maxFaces, 0, 0);
        
        /* copy verts from mesh */
        mvert_orig =    dm->getVertArray(dm);
        medge_orig =    dm->getEdgeArray(dm);
        
        mvert_new =             result->getVertArray(result);
-       mface_new =             result->getFaceArray(result);
+       mface_new =             result->getTessFaceArray(result);
        medge_new =             result->getEdgeArray(result);
        
-       origindex= result->getFaceDataArray(result, CD_ORIGINDEX);
+       origindex= result->getTessFaceDataArray(result, CD_ORIGINDEX);
 
        DM_copy_vert_data(dm, result, 0, 0, totvert); /* copy first otherwise this overwrites our own vertex normals */
        
@@ -830,7 +830,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                CDDM_calc_normals(result);
        }
 
-       return result;
+       dm = CDDM_copy(result, 1); /*builds ngon faces from tess (mface) faces*/
+       result->needsFree = 1;
+       result->release(result);
+       
+       return dm;
 }
 
 
@@ -864,7 +868,7 @@ static void foreachObjectLink(
 static DerivedMesh *applyModifierEM(
                                                ModifierData *md,
                                                Object *ob,
-                                               struct EditMesh *UNUSED(editData),
+                                               struct BMEditMesh *UNUSED(editData),
                                                DerivedMesh *derivedData)
 {
        return applyModifier(md, ob, derivedData, 0, 1);