[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43754] branches/bmesh/blender/source/ blender: remove CDDM_copy second argument, added CDDM_copy_from_tessface instead.

Campbell Barton ideasman42 at gmail.com
Sun Jan 29 22:59:49 CET 2012


Revision: 43754
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43754
Author:   campbellbarton
Date:     2012-01-29 21:59:47 +0000 (Sun, 29 Jan 2012)
Log Message:
-----------
remove CDDM_copy second argument, added CDDM_copy_from_tessface instead.

this function caused too many conflicts and in most cases was zero anyway.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h
    branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
    branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/bmesh/blender/source/blender/blenkernel/intern/displist.c
    branches/bmesh/blender/source/blender/blenkernel/intern/dynamicpaint.c
    branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
    branches/bmesh/blender/source/blender/blenkernel/intern/particle.c
    branches/bmesh/blender/source/blender/blenkernel/intern/particle_system.c
    branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c
    branches/bmesh/blender/source/blender/editors/object/object_bake.c
    branches/bmesh/blender/source/blender/editors/physics/particle_object.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_bevel.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_cloth.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_collision.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_decimate.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_multires.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_ngoninterp.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_ocean.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_particlesystem.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_remesh.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_subsurf.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_surface.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_util.c

Modified: branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/BKE_cdderivedmesh.h	2012-01-29 21:59:47 UTC (rev 43754)
@@ -76,7 +76,8 @@
 /* Copies the given DerivedMesh with verts, faces & edges stored as
  * custom element data.
  */
-struct DerivedMesh *CDDM_copy(struct DerivedMesh *dm, int faces_from_tessfaces);
+struct DerivedMesh *CDDM_copy(struct DerivedMesh *dm);
+struct DerivedMesh *CDDM_copy_from_tessface(struct DerivedMesh *dm);
 
 /* creates a CDDerivedMesh with the same layer stack configuration as the
  * given DerivedMesh and containing the requested numbers of elements.

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -1448,7 +1448,7 @@
 			/* apply vertex coordinates or build a DerivedMesh as necessary */
 			if(dm) {
 				if(deformedVerts) {
-					DerivedMesh *tdm = CDDM_copy(dm, 0);
+					DerivedMesh *tdm = CDDM_copy(dm);
 					dm->release(dm);
 					dm = tdm;
 
@@ -1582,7 +1582,7 @@
 	 * DerivedMesh then we need to build one.
 	 */
 	if(dm && deformedVerts) {
-		finaldm = CDDM_copy(dm, 0);
+		finaldm = CDDM_copy(dm);
 
 		dm->release(dm);
 
@@ -1775,7 +1775,7 @@
 			/* apply vertex coordinates or build a DerivedMesh as necessary */
 			if(dm) {
 				if(deformedVerts) {
-					DerivedMesh *tdm = CDDM_copy(dm, 0);
+					DerivedMesh *tdm = CDDM_copy(dm);
 					if(!(cage_r && dm == *cage_r)) dm->release(dm);
 					dm = tdm;
 
@@ -1784,7 +1784,7 @@
 				} else if(cage_r && dm == *cage_r) {
 					/* dm may be changed by this modifier, so we need to copy it
 					 */
-					dm = CDDM_copy(dm, 0);
+					dm = CDDM_copy(dm);
 				}
 
 			} else {
@@ -1846,7 +1846,7 @@
 
 		if(cage_r && i == cageIndex) {
 			if(dm && deformedVerts) {
-				*cage_r = CDDM_copy(dm, 0);
+				*cage_r = CDDM_copy(dm);
 				CDDM_apply_vert_coords(*cage_r, deformedVerts);
 			} else if(dm) {
 				*cage_r = dm;
@@ -1865,7 +1865,7 @@
 	 * then we need to build one.
 	 */
 	if(dm && deformedVerts) {
-		*final_r = CDDM_copy(dm, 0);
+		*final_r = CDDM_copy(dm);
 
 		if(!(cage_r && dm == *cage_r)) dm->release(dm);
 

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -2124,7 +2124,7 @@
 	return dm;
 }
 
-DerivedMesh *CDDM_copy(DerivedMesh *source, int faces_from_tessfaces)
+static DerivedMesh *cddm_copy_ex(DerivedMesh *source, int faces_from_tessfaces)
 {
 	CDDerivedMesh *cddm = cdDM_create("CDDM_copy cddm");
 	DerivedMesh *dm = &cddm->dm;
@@ -2175,6 +2175,16 @@
 	return dm;
 }
 
+DerivedMesh *CDDM_copy(DerivedMesh *source)
+{
+	return cddm_copy_ex(source, 0);
+}
+
+DerivedMesh *CDDM_copy_from_tessface(DerivedMesh *source)
+{
+	return cddm_copy_ex(source, 1);
+}
+
 /* note, the CD_ORIGINDEX layers are all 0, so if there is a direct
  * relationship betwen mesh data this needs to be set by the caller. */
 DerivedMesh *CDDM_from_template(DerivedMesh *source,

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/displist.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/displist.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/displist.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -887,7 +887,7 @@
 
 			if (dm) {
 				if (vertCos) {
-					DerivedMesh *tdm = CDDM_copy(dm, 0);
+					DerivedMesh *tdm = CDDM_copy(dm);
 					dm->release(dm);
 					dm = tdm;
 
@@ -928,7 +928,7 @@
 
 	if (vertCos) {
 		if (dm) {
-			DerivedMesh *tdm = CDDM_copy(dm, 0);
+			DerivedMesh *tdm = CDDM_copy(dm);
 			dm->release(dm);
 			dm = tdm;
 

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/dynamicpaint.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/dynamicpaint.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -1572,7 +1572,7 @@
                                                        Object *ob,
                                                        DerivedMesh *dm)
 {	
-	DerivedMesh *result = CDDM_copy(dm, 0);
+	DerivedMesh *result = CDDM_copy(dm);
 
 	if(pmd->canvas && !(pmd->canvas->flags & MOD_DPAINT_BAKING)) {
 
@@ -1774,7 +1774,7 @@
 	/* make a copy of dm to use as brush data */
 	if (pmd->brush) {
 		if (pmd->brush->dm) pmd->brush->dm->release(pmd->brush->dm);
-		pmd->brush->dm = CDDM_copy(result, 0);
+		pmd->brush->dm = CDDM_copy(result);
 	}
 
 	return result;
@@ -1792,7 +1792,7 @@
 void canvas_copyDerivedMesh(DynamicPaintCanvasSettings *canvas, DerivedMesh *dm)
 {
 	if (canvas->dm) canvas->dm->release(canvas->dm);
-	canvas->dm = CDDM_copy(dm, 0);
+	canvas->dm = CDDM_copy(dm);
 }
 
 /*
@@ -3045,7 +3045,7 @@
 	scene->r.subframe = prev_sfra;
 
 	subframe_updateObject(scene, ob, UPDATE_EVERYTHING, BKE_curframe(scene));
-	dm_p = CDDM_copy(brush->dm, 0);
+	dm_p = CDDM_copy(brush->dm);
 	numOfVerts_p = dm_p->getNumVerts(dm_p);
 	mvert_p = dm_p->getVertArray(dm_p);
 	copy_m4_m4(prev_obmat, ob->obmat);
@@ -3150,7 +3150,7 @@
 		Bounds3D mesh_bb = {0};
 		VolumeGrid *grid = bData->grid;
 
-		dm = CDDM_copy(brush->dm, 0);
+		dm = CDDM_copy(brush->dm);
 		mvert = dm->getVertArray(dm);
 		mface = dm->getTessFaceArray(dm);
 		numOfVerts = dm->getNumVerts(dm);

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/multires.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/multires.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -79,7 +79,7 @@
 
 	dm = mti->applyModifier(md, ob, tdm, 0, 1);
 	if (dm == tdm) {
-		dm = CDDM_copy(tdm, 0);
+		dm = CDDM_copy(tdm);
 	}
 
 	return dm;
@@ -238,7 +238,7 @@
 	dm->getVertCos(dm, deformedVerts);
 	mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0, 0);
 
-	ndm= CDDM_copy(dm, 0);
+	ndm= CDDM_copy(dm);
 	CDDM_apply_vert_coords(ndm, deformedVerts);
 
 	MEM_freeN(deformedVerts);
@@ -846,7 +846,7 @@
 			int i, j, numGrids, highGridSize, lowGridSize;
 
 			/* create subsurf DM from original mesh at high level */
-			if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform, 0);
+			if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
 			else cddm = CDDM_from_mesh(me, NULL);
 			DM_set_only_copy(cddm, CD_MASK_BAREMESH);
 
@@ -900,7 +900,7 @@
 		else {
 			DerivedMesh *cddm, *subdm;
 
-			if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform, 0);
+			if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
 			else cddm = CDDM_from_mesh(me, NULL);
 			DM_set_only_copy(cddm, CD_MASK_BAREMESH);
 

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/particle.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/particle.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -699,7 +699,7 @@
 	data->totchildcache= psys->totchildcache;
 
 	if(psmd->dm)
-		data->dm= CDDM_copy(psmd->dm, 0);
+		data->dm= CDDM_copy(psmd->dm);
 	data->totdmvert= psmd->totdmvert;
 	data->totdmedge= psmd->totdmedge;
 	data->totdmface= psmd->totdmface;

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/particle_system.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/particle_system.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -3584,7 +3584,7 @@
 	psys->clmd->sim_parms->effector_weights = psys->part->effector_weights;
 
 	deformedVerts = MEM_callocN(sizeof(*deformedVerts)*dm->getNumVerts(dm), "do_hair_dynamics vertexCos");
-	psys->hair_out_dm = CDDM_copy(dm, 0);
+	psys->hair_out_dm = CDDM_copy(dm);
 	psys->hair_out_dm->getVertCos(psys->hair_out_dm, deformedVerts);
 
 	clothModifier_do(psys->clmd, sim->scene, sim->ob, dm, deformedVerts);

Modified: branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -4598,7 +4598,7 @@
 	} else {
 		dm = mesh_get_derived_final(scene, ob, CD_MASK_DERIVEDMESH);
 		if (!CDDM_Check(dm)) {
-			dm = CDDM_copy(dm, 0);
+			dm = CDDM_copy(dm);
 			free = 1;
 		} else {
 			free = 0;

Modified: branches/bmesh/blender/source/blender/editors/object/object_bake.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/object/object_bake.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/editors/object/object_bake.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -996,7 +996,7 @@
 
 	if(*lvl==0) {
 		DerivedMesh *tmp_dm= CDDM_from_mesh(me, ob);
-		dm= CDDM_copy(tmp_dm, 0);
+		dm= CDDM_copy(tmp_dm);
 		tmp_dm->release(tmp_dm);
 	} else {
 		MultiresModifierData tmp_mmd= *mmd;

Modified: branches/bmesh/blender/source/blender/editors/physics/particle_object.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/physics/particle_object.c	2012-01-29 21:49:49 UTC (rev 43753)
+++ branches/bmesh/blender/source/blender/editors/physics/particle_object.c	2012-01-29 21:59:47 UTC (rev 43754)
@@ -645,7 +645,7 @@
 	

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list