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:
authorHans Goudey <h.goudey@me.com>2020-05-19 23:40:40 +0300
committerHans Goudey <h.goudey@me.com>2020-05-19 23:40:40 +0300
commitc554f4e14fce679e047fd8ee75368548de70d0cb (patch)
treed8a9137d4d32435852c2e2246eb5e9b12b20e720 /source/blender/bmesh
parent13125e0948816f0debe6d298e9c7b436fb5a1db1 (diff)
Fix T75383:Bevel weird behaviour when using bevel weights
Don't use the cube corner special case when the offsets are different for the three edges involved. The generic VMesh for this situation isn't perfect, but it's much better than a failed cube corner VMesh. Tests pass.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index bc127243836..0891070ce77 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -4167,6 +4167,10 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv)
if (bv->vmesh->count != 3) {
return 0;
}
+
+ /* Only use the tri-corner special case if the offset is the same for every edge. */
+ float offset = bv->edges[0].offset_l;
+
totang = 0.0f;
for (i = 0; i < bv->edgecount; i++) {
e = &bv->edges[i];
@@ -4178,6 +4182,11 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv)
else if (absang >= 3.0f * (float)M_PI_4) {
return -1;
}
+
+ if (e->is_bev && !compare_ff(e->offset_l, offset, BEVEL_EPSILON)) {
+ return -1;
+ }
+
totang += ang;
}
if (in_plane_e != bv->edgecount - 3) {