call CDDM_from_BMEditMesh without creating tessface data for modifiers.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 Jan 2012 15:29:25 +0000 (15:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 Jan 2012 15:29:25 +0000 (15:29 +0000)
- in the case of deform modifiers this is very safe (assuming the mods themselves dont need tessface data), since the DM is freed right after, so this is an easy speedup.

- in the case of bevel and split edge modifiers this should still work out fine since mods that need tessface data will generate it.

source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/constraint.c
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/modifiers/intern/MOD_armature.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_curve.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_lattice.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index 059297f392af14b5a39f717976105a34627e7f1f..e6acfbf961755d2c4917d3980f71135b846ce27b 100644 (file)
@@ -807,7 +807,7 @@ static DerivedMesh *create_orco_dm(Object *ob, Mesh *me, BMEditMesh *em, int lay
        float (*orco)[3];
        int free;
 
-       if(em) dm= CDDM_from_BMEditMesh(em, me, FALSE, TRUE);
+       if(em) dm= CDDM_from_BMEditMesh(em, me, FALSE, FALSE);
        else dm= CDDM_from_mesh(me, ob);
 
        orco= get_orco_coords_dm(ob, em, layer, &free);
index 5babb6261779740a31aea5070648053ab361b43d..3bcbb782e82bc0ac86ffbc2a383d34a7a514cbc8 100644 (file)
@@ -454,7 +454,7 @@ static void contarget_get_mesh_mat (Object *ob, const char *substring, float mat
        /* get DerivedMesh */
        if (em) {
                /* target is in editmode, so get a special derived mesh */
-               dm = CDDM_from_BMEditMesh(em, ob->data, FALSE, TRUE);
+               dm = CDDM_from_BMEditMesh(em, ob->data, FALSE, FALSE);
                freeDM= 1;
        }
        else {
index 2565dd0f649b7a8b6e663b2c26bfb79b247b0196..b1cc30478c037af0b8f903e0a6c7acf1f7bbc3c7 100644 (file)
@@ -375,7 +375,7 @@ static void bmesh_set_mdisps_space(BMesh *bm, int from, int to)
        if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
                Object *ob = bm->ob;
                BMEditMesh *em = BMEdit_Create(bm);
-               DerivedMesh *dm = CDDM_from_BMEditMesh(em, NULL, TRUE, TRUE);
+               DerivedMesh *dm = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
                MDisps *mdisps;
                BMFace *f;
                BMIter iter;
index fe5893d0911cadb1d3d7d44c2bb2851f96227e94..7260e39e9829a2a1963a941cac489aa4bd1aab2f 100644 (file)
@@ -142,7 +142,7 @@ static void deformVertsEM(
        ArmatureModifierData *amd = (ArmatureModifierData*) md;
        DerivedMesh *dm = derivedData;
 
-       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, TRUE);
+       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
 
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
 
@@ -166,7 +166,7 @@ static void deformMatricesEM(
        ArmatureModifierData *amd = (ArmatureModifierData*) md;
        DerivedMesh *dm = derivedData;
 
-       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, TRUE);
+       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
 
        armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
                              amd->deformflag, NULL, amd->defgrp_name);
index 73c4903b277102f35920837270e0e600d093c81f..55f2b745937a22677329001db8b17ff9e23b665c 100644 (file)
@@ -389,7 +389,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
        BMO_pop(em->bm);
 
        BMEdit_RecalcTesselation(em);
-       cddm = CDDM_from_BMEditMesh(em, NULL, FALSE, TRUE);
+       cddm = CDDM_from_BMEditMesh(em, NULL, FALSE, FALSE);
 
        BMEdit_Free(em);
        MEM_freeN(em);
index 7e57369776277b1055a2381db2df352cf1968172..3ff6d84f1f6adb8fc4f2ac110e1039c3a0c16a19 100644 (file)
@@ -159,7 +159,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
                cddm->release(cddm);
        }
 
-       cddm = CDDM_from_BMEditMesh(em, NULL, TRUE, TRUE);
+       cddm = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
        BMEdit_Free(em);
        MEM_freeN(em);
 
index ab9b509ee9c1ef06153d779332a12d5ad9a14ead..dcde921f84481975b1d8f88d2a0bf5fd596ca3e3 100644 (file)
@@ -129,7 +129,7 @@ static void deformVertsEM(
 {
        DerivedMesh *dm = derivedData;
 
-       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, TRUE);
+       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
 
index da5e9ccc45fc906e40e4532866fef9a01d7fbdc5..571f01d570ebcb2fe7bc9f751785675d9ac8a548 100644 (file)
@@ -108,7 +108,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
                cddm->release(cddm);
        }
        
-       cddm = CDDM_from_BMEditMesh(em, NULL, TRUE, TRUE);
+       cddm = CDDM_from_BMEditMesh(em, NULL, TRUE, FALSE);
        BMEdit_Free(em);
        MEM_freeN(em);
        
index 2e8b5e3e6f3b33db76156e5406725a0e174c052c..00a634e8838871a9695146b111aeb866283d3192 100644 (file)
@@ -124,7 +124,7 @@ static void deformVertsEM(
 {
        DerivedMesh *dm = derivedData;
 
-       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, TRUE);
+       if(!derivedData) dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
 
index d20a914a5315ea6eab2903eb8dfe341bd95c80e3..4d058197be5bca042ed81a5488d20620b8700798 100644 (file)
@@ -338,7 +338,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editD
 
        if(use_dm) {
                if(!derivedData)
-                       dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, TRUE);
+                       dm = CDDM_from_BMEditMesh(editData, ob->data, FALSE, FALSE);
        }
 
        deformVerts(md, ob, dm, vertexCos, numVerts, 0, 0);
index 022aa150d493572542eba632de7ae697d204f718..22128784ddad4f7c667b4cfc4ffd631c0d3271bb 100644 (file)
@@ -451,7 +451,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                else if (obr->type == OB_MESH) {
                                        Mesh *me = (Mesh*)obr->data;
                                        if (me->edit_btmesh)
-                                               target_dm = CDDM_from_BMEditMesh(me->edit_btmesh, me, FALSE, TRUE);
+                                               target_dm = CDDM_from_BMEditMesh(me->edit_btmesh, me, FALSE, FALSE);
                                        else
                                                target_dm = CDDM_from_mesh(me, obr);
                                }