[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45737] trunk/blender/source/blender/bmesh /tools/BME_bevel.c: fix [#30921] Bevel modifier' s is not work correctly with bevel weights
Campbell Barton
ideasman42 at gmail.com
Wed Apr 18 09:29:13 CEST 2012
Revision: 45737
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45737
Author: campbellbarton
Date: 2012-04-18 07:29:12 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
fix [#30921] Bevel modifier's is not work correctly with bevel weights
replace dissolve function with one from 2.62 (updated for the new bmesh api).
Modified Paths:
--------------
trunk/blender/source/blender/bmesh/tools/BME_bevel.c
Modified: trunk/blender/source/blender/bmesh/tools/BME_bevel.c
===================================================================
--- trunk/blender/source/blender/bmesh/tools/BME_bevel.c 2012-04-18 07:27:15 UTC (rev 45736)
+++ trunk/blender/source/blender/bmesh/tools/BME_bevel.c 2012-04-18 07:29:12 UTC (rev 45737)
@@ -144,65 +144,34 @@
return BLI_memarena_alloc(td->ma, sizeof(float));
}
-/* BM_disk_dissolve is a real mess, and crashes bevel if called instead of this.
- * The drawback, though, is that this code doesn't merge customdata. */
-static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
+/* ported from before bmesh merge into trunk (was called)
+ * problem with this is it creates 2 vert faces */
+static void BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v)
{
- BMIter iter;
- BMEdge *e, *elast;
- BMLoop *l1, *l2;
+ BMFace *f;
+ BMEdge *e;
+ int done;
- if (!BM_vert_is_manifold(v)) {
- return 0;
- }
-
- /* hrmf, we could have a version of BM_vert_is_manifold() which checks for this case */
- BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) {
- if (!BM_edge_is_manifold(e)) {
- return 0;
- }
- }
-
- if (BM_vert_edge_count(v) > 2) {
- while (BM_vert_edge_count(v) > 2) {
- e = v->e;
- l1 = e->l;
- l2 = l1->radial_next;
- if (l1->v == l2->v) {
- /* faces have incompatible directions; need to reverse one */
- if (!bmesh_loop_reverse(bm, l2->f)) {
- BLI_assert(!"bevel dissolve disk cannot reverse loop");
- return 0;
+ if (v->e) {
+ done = 0;
+ while (!done){
+ done = 1;
+ e = v->e; /*loop the edge looking for a edge to dissolve*/
+ do {
+ f = NULL;
+ if (BM_edge_is_manifold(e)) {
+ f = bmesh_jfke(bm, e->l->f, e->l->radial_next->f, e);
}
- l2 = l1->radial_next;
- }
- if (!bmesh_jfke(bm, l1->f, l2->f, e)) {
- BLI_assert(!"bevel dissolve disk cannot join faces");
- return 0;
- }
- }
-
- e = v->e;
- elast = bmesh_disk_edge_next(e, v);
-
- /* BMESH_TODO, figure out if its possible we had a double edge here and need to splice it,
- * last bool arg */
- bmesh_jekv(bm, e, v, FALSE);
-
- l1 = elast->l;
- l2 = l1->radial_next;
- if (l1->v == l2->v) {
- /* faces have incompatible directions */
- if (!bmesh_loop_reverse(bm, l2->f)) {
- BLI_assert(!"bevel dissolve disk cannot reverse loop");
- return 0;
+ if (f) {
+ done = 0;
+ break;
}
- l2 = l1->radial_next;
+ e = bmesh_disk_edge_next(e, v);
+ } while(e != v->e);
}
- bmesh_jfke(bm, l1->f, l2->f, elast);
+ BM_vert_collapse_edge(bm, v->e, v, TRUE);
+ // bmesh_jekv(bm, v->e, v, FALSE);
}
-
- return 1;
}
static int BME_bevel_is_split_vert(BMesh *bm, BMLoop *l)
More information about the Bf-blender-cvs
mailing list