Commit: 5a11c8ba244d966813ff491d9e295f13b7d7d248
Author: Campbell Barton
Date: Wed Jul 15 21:48:28 2020 +1000
Branches: master
https://developer.blender.org/rB5a11c8ba244d966813ff491d9e295f13b7d7d248
Fix T68845: Follow Active Quads, divide by zero error
===================================================================
M release/scripts/startup/bl_operators/uvcalc_follow_active.py
===================================================================
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
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs