[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51462] trunk/blender/source/blender/bmesh /intern/bmesh_decimate.c: bmesh-decimator, skip recalculating face normals on each edge collapse.
Campbell Barton
ideasman42 at gmail.com
Sat Oct 20 20:12:23 CEST 2012
Revision: 51462
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51462
Author: campbellbarton
Date: 2012-10-20 18:12:22 +0000 (Sat, 20 Oct 2012)
Log Message:
-----------
bmesh-decimator, skip recalculating face normals on each edge collapse. (they are not used so faster to avoid)
Modified Paths:
--------------
trunk/blender/source/blender/bmesh/intern/bmesh_decimate.c
Modified: trunk/blender/source/blender/bmesh/intern/bmesh_decimate.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_decimate.c 2012-10-20 17:50:24 UTC (rev 51461)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_decimate.c 2012-10-20 18:12:22 UTC (rev 51462)
@@ -53,7 +53,7 @@
typedef enum CD_UseFlag {
CD_DO_VERT,
- CD_DO_EDGE, /* not used yet */
+ CD_DO_EDGE,
CD_DO_LOOP
} CD_UseFlag;
@@ -335,7 +335,8 @@
/**
* \param v is the target to merge into.
*/
-static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_clear, BMVert *v_other, const float customdata_fac)
+static void bm_edge_collapse_loop_customdata(BMesh *bm, BMLoop *l, BMVert *v_clear, BMVert *v_other,
+ const float customdata_fac)
{
/* these don't need to be updated, since they will get removed when the edge collapses */
BMLoop *l_clear, *l_other;
@@ -622,8 +623,11 @@
BLI_quadric_add_qu_qu(&vquadrics[BM_elem_index_get(v)], &vquadrics[v_clear_index]);
/* update connected normals */
- BM_vert_normal_update_all(v);
+ /* in fact face normals are not used for progressive updates, no need to update them */
+ // BM_vert_normal_update_all(v);
+ BM_vert_normal_update(v);
+
/* update error costs and the eheap */
if (LIKELY(v->e)) {
BMEdge *e_iter;
@@ -647,6 +651,9 @@
}
}
+ /* could get some extra quality out of this but its not really needed */
+ // BM_vert_normal_update(BM_edge_other_vert(e_iter, v));
+
/* if this happens, the e_double check could be put in a while loop,
* so as to keep removing doubles while they are found. so far this isnt needed */
BLI_assert(BM_edge_find_double(e_iter) == NULL);
@@ -731,4 +738,6 @@
/* testing only */
// BM_mesh_validate(bm);
+
+ (void)tot_edge_orig; /* quiet release build warning */
}
More information about the Bf-blender-cvs
mailing list