diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-15 14:48:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-15 14:48:28 +0300 |
commit | 5a11c8ba244d966813ff491d9e295f13b7d7d248 (patch) | |
tree | 8aea6a16e64efcb26b6a86e07e9d67ce829376a7 /release | |
parent | 87f8949f0ec15945d27b83131a6283ac8b2f5f0a (diff) |
Fix T68845: Follow Active Quads, divide by zero error
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/uvcalc_follow_active.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py index 6f441238606..4343717f264 100644 --- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py +++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py @@ -160,7 +160,12 @@ def extend(obj, EXTEND_MODE): l_b_uv = [l[uv_act].uv for l in l_b] if EXTEND_MODE == 'LENGTH_AVERAGE': - fac = edge_lengths[l_b[2].edge.index][0] / edge_lengths[l_a[1].edge.index][0] + d1 = edge_lengths[l_a[1].edge.index][0] + d2 = edge_lengths[l_b[2].edge.index][0] + try: + fac = d2 / d1 + except ZeroDivisionError: + fac = 1.0 elif EXTEND_MODE == 'LENGTH': a0, b0, c0 = l_a[3].vert.co, l_a[0].vert.co, l_b[3].vert.co a1, b1, c1 = l_a[2].vert.co, l_a[1].vert.co, l_b[2].vert.co |