[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43496] branches/bmesh/blender/source/ blender: call CDDM_from_BMEditMesh without creating tessface data for modifiers.

Campbell Barton ideasman42 at gmail.com
Wed Jan 18 16:29:26 CET 2012


Revision: 43496
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43496
Author:   campbellbarton
Date:     2012-01-18 15:29:25 +0000 (Wed, 18 Jan 2012)
Log Message:
-----------
call CDDM_from_BMEditMesh without creating tessface data for modifiers.

- 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.

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

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -807,7 +807,7 @@
 	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);

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/constraint.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/constraint.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -454,7 +454,7 @@
 	/* 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 {

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -375,7 +375,7 @@
 	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;

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_armature.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_armature.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_armature.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -142,7 +142,7 @@
 	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 @@
 	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);

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -389,7 +389,7 @@
 	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);

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_bevel.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_bevel.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_bevel.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -159,7 +159,7 @@
 		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);
 

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_curve.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_curve.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_curve.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -129,7 +129,7 @@
 {
 	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);
 

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -108,7 +108,7 @@
 		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);
 	

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_lattice.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_lattice.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_lattice.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -124,7 +124,7 @@
 {
 	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);
 

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_warp.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_warp.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_warp.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -338,7 +338,7 @@
 
 	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);

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c	2012-01-18 15:23:36 UTC (rev 43495)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c	2012-01-18 15:29:25 UTC (rev 43496)
@@ -451,7 +451,7 @@
 				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);
 				}



More information about the Bf-blender-cvs mailing list