Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-02-25 07:53:37 +0300
committerGeoffrey Bantle <hairbat@yahoo.com>2008-02-25 07:53:37 +0300
commitd566fe665ad1c9f5a1078fba76f230fdd8675452 (patch)
treed07bbfbe316bf789438236934697d61595150d22 /source/blender/blenkernel/intern/BME_mesh.c
parent3023458aa7319a100cfb248a3ace72de5f854670 (diff)
-> Bevel
Fixed the following problems with Bevel code -meshes with 2 edged faces left over at the end would cause buffer overrun whens converting from a Bmesh to a Derived Mesh. The conversion process now checks for both double edges and faces and removes them when present. -BME_reverse_loop euler had a bug that was causing the corruption of radial cycle. This would lead to the bevel tool hanging for a long time and possibly crashing. -Added optimization of BME_reverse loop so that it no longer does tiny allocations but instead uses an area of 'scratch' memory. The same thing will be done to the Make Face euler soon -Added proper call to selection flushing for editmode. -Some miscellaneous cleanups and removal of unneeded debug printfs.
Diffstat (limited to 'source/blender/blenkernel/intern/BME_mesh.c')
-rw-r--r--source/blender/blenkernel/intern/BME_mesh.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c
index b6f4bc0a1bc..064db8cf148 100644
--- a/source/blender/blenkernel/intern/BME_mesh.c
+++ b/source/blender/blenkernel/intern/BME_mesh.c
@@ -134,24 +134,6 @@ void BME_free_mesh(BME_Mesh *bm)
}
/*
- * BME COPY MESH
- *
- * Copies a BME_Mesh structure.
- *
- * This is probably more low level than any mesh manipulation routine should be
- * and somewhat violates the rule about modifying/creating mesh structures outside
- * of the euler API. Regardless, its much more effecient than rebuilding the mesh
- * from scratch.
-*/
-
-BME_Mesh *BME_copy_mesh(BME_Mesh *bm)
-{
- BME_Mesh *meshcopy;
- meshcopy = BME_make_mesh();
- return meshcopy;
-}
-
-/*
* BME MODEL BEGIN AND END
*
* These two functions represent the 'point of entry' for tools. Every BMesh tool
@@ -173,9 +155,9 @@ BME_Mesh *BME_copy_mesh(BME_Mesh *bm)
*/
int BME_model_begin(BME_Mesh *bm){
- if(bm->lock) return 0;
- bm->lock = 1;
- bm->backup = BME_copy_mesh(bm);
+ /*scratch edge pointer array*/
+ bm->edar = MEM_callocN(sizeof(BME_Edge *) * 1024, "BMesh scratch edge array");
+ bm->edarlen = 1024;
return 1;
}
@@ -188,23 +170,20 @@ void BME_model_end(BME_Mesh *bm){
totpoly = BLI_countlist(&(bm->polys));
totloop = BLI_countlist(&(bm->loops));
+ if(bm->edar){
+ MEM_freeN(bm->edar);
+ bm->edar = NULL;
+ bm->edarlen = 0;
+ }
if(bm->totvert!=totvert || bm->totedge!=totedge || bm->totpoly!=totpoly || bm->totloop!=totloop)
BME_error();
meshok = BME_validate_mesh(bm, 1);
if(!meshok){
- printf("Warning, Mesh failed validation, restoring from backup");
- badmesh = bm;
- bm= badmesh->backup;
- bm->backup = badmesh;
- backupok = BME_validate_mesh(bm,1);
- if(!backupok) printf("Backup corrupted too, Briggs did something stupid!");
+ BME_error();
}
- BME_free_mesh(bm->backup);
- bm->lock = 0;
}
-
/*
* BME VALIDATE MESH
*
@@ -220,7 +199,6 @@ void BME_model_end(BME_Mesh *bm){
*
* TODO
*
- * -Add validation for hole loops (which are experimental anyway)
* -Write a full mesh validation function for debugging purposes.
*/