[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43103] branches/bmesh/blender/source/ blender: for modifiers that are stull creating MFaces - call CDDM_tessfaces_to_faces rather then making an entire copy with CDDM_copy (result, 1)

Campbell Barton ideasman42 at gmail.com
Tue Jan 3 16:29:09 CET 2012


Revision: 43103
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43103
Author:   campbellbarton
Date:     2012-01-03 15:28:53 +0000 (Tue, 03 Jan 2012)
Log Message:
-----------
for modifiers that are stull creating MFaces - call CDDM_tessfaces_to_faces rather then making an entire copy with CDDM_copy(result, 1)

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_decimate.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_explode.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_ngoninterp.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_particleinstance.c

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -484,28 +484,6 @@
 		MEM_freeN(wtable->weight_table);
 }
 
-#if 0
-static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh,
-								 int drawInteriorEdges, int useSubsurfUv,
-								 DerivedMesh *dm, struct MultiresSubsurf *ms)
-{
-	DerivedMesh *cgdm, *result;
-	double curt = PIL_check_seconds_timer();
-
-	cgdm = getCCGDerivedMesh(ss, drawInteriorEdges, useSubsurfUv, dm);
-	result = CDDM_copy(cgdm, 1);
-
-	printf("subsurf conversion time: %.6lf\n", PIL_check_seconds_timer() - curt);
-
-	cgdm->needsFree = 1;
-	cgdm->release(cgdm);
-
-	CDDM_calc_normals(result);
-
-	return result;
-}
-#endif
-
 static int ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
 									 float (*vertexCos)[3], int useFlatSubdiv)
 {

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -346,7 +346,7 @@
 	DerivedMesh *dm2,
 	Object *ob2)
 {
-	DerivedMesh *result, *orig_dm, *dm;
+	DerivedMesh *result, *orig_dm;
 	GHash *material_hash = NULL;
 	Mesh *me1= (Mesh*)ob1->data;
 	Mesh *me2= (Mesh*)ob2->data;
@@ -434,12 +434,9 @@
 
 	CDDM_calc_edges(result);
 
-	dm = CDDM_copy(result, 1); /*builds ngon faces from tess (mface) faces*/
-	CDDM_calc_normals(dm);
-	result->needsFree = 1;
-	result->release(result);
+	CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
 
-	return dm;
+	return result;
 }
 	
 static void BuildMeshDescriptors(

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_decimate.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_decimate.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_decimate.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -181,12 +181,14 @@
 	MEM_freeN(lod.vertex_normal_buffer);
 	MEM_freeN(lod.triangle_index_buffer);
 
-	dm = CDDM_copy(result, 1); /*builds ngon faces from tess (mface) faces*/
-	CDDM_calc_normals(dm);
-	result->needsFree = 1;
-	result->release(result);
+	if (result) {
+		CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
 
-	return dm;
+		return result;
+	}
+	else {
+		return dm;
+	}
 }
 #else // WITH_MOD_DECIMATE
 static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_explode.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_explode.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_explode.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -774,11 +774,9 @@
 	MEM_freeN(facesplit);
 	MEM_freeN(vertpa);
 
-	dm = CDDM_copy(splitdm, 1); /*builds ngon faces from tess (mface) faces*/
-	splitdm->needsFree = 1;
-	splitdm->release(splitdm);
+	CDDM_tessfaces_to_faces(splitdm); /*builds ngon faces from tess (mface) faces*/
 
-	return dm;
+	return splitdm;
 }
 static DerivedMesh * explodeMesh(ExplodeModifierData *emd, 
 		ParticleSystemModifierData *psmd, Scene *scene, Object *ob, 

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_ngoninterp.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_ngoninterp.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_ngoninterp.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -297,16 +297,7 @@
 	dummy->release(dummy);
 	
 	/*create polys from mface triangles*/
-	dummy = cddm;
-	cddm = CDDM_copy(cddm, 1);
-	dummy->needsFree = 1;
-	dummy->release(dummy);
-	
-	if (copy) {
-		copy->needsFree = 1;
-		copy->release(dm);
-		copy = copy;
-	}
+	CDDM_tessfaces_to_faces(cddm); /*builds ngon faces from tess (mface) faces*/
 
 	return cddm;
 }
@@ -336,4 +327,3 @@
 	/* foreachObjectLink */ 0,
 	/* foreachIDLink */     0,
 };
-

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_particleinstance.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_particleinstance.c	2012-01-03 14:56:48 UTC (rev 43102)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_particleinstance.c	2012-01-03 15:28:53 UTC (rev 43103)
@@ -312,11 +312,9 @@
 	if(size)
 		MEM_freeN(size);
 
-	dm = CDDM_copy(result, 1); /*builds ngon faces from tess (mface) faces*/
-	result->needsFree = 1;
-	result->release(result);
+	CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
 
-	return dm;
+	return result;
 }
 static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
 						struct BMEditMesh *UNUSED(editData),



More information about the Bf-blender-cvs mailing list