diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 03:01:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-24 03:01:03 +0400 |
commit | 03f451f2f18cccd80d0d56391c4836da34641a60 (patch) | |
tree | cccbf490c4f740bf074418b9c61ae3732eec8698 /source/blender/bmesh/operators | |
parent | 68595376795ce7cc9bf01fb5851a2bc76a97a01c (diff) |
fix own error with subdivision (broke icosphere), also noticed icosphere vanished at subd-5 which didnt happen before bmesh.
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index d5f46ebfc85..7da02a594d5 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -109,7 +109,11 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar copy_v3_v3(co, v->co); copy_v3_v3(prev_co, co); - if (params->use_smooth) { + if (UNLIKELY(params->use_sphere)) { /* subdivide sphere */ + normalize_v3(co); + mul_v3_fl(co, params->smooth); + } + else if (params->use_smooth) { /* we calculate an offset vector vec1[], to be added to *co */ float len, nor[3], nor1[3], nor2[3], smooth = params->smooth; @@ -134,10 +138,6 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDPar add_v3_v3(co, tvec); } - else if (params->use_sphere) { /* subdivide sphere */ - normalize_v3(co); - mul_v3_fl(co, params->smooth); - } if (params->use_fractal) { float len = len_v3v3(vsta->co, vend->co); |