[Bf-blender-cvs] [0a00fbd265a] blender-v2.83-release: Fix T66967: skin modifier crash scaling skin radius to zero

Campbell Barton noreply at git.blender.org
Tue Jun 2 15:46:45 CEST 2020


Commit: 0a00fbd265ac75e2d900f34570a6842e7ea70a2e
Author: Campbell Barton
Date:   Tue Jun 2 23:45:51 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB0a00fbd265ac75e2d900f34570a6842e7ea70a2e

Fix T66967: skin modifier crash scaling skin radius to zero

===================================================================

M	source/blender/modifiers/intern/MOD_skin.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index ec7c2b5b1a4..15ed2f36439 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -922,7 +922,13 @@ static Mesh *subdivide_base(Mesh *orig)
 
     u = e->v1;
     radrat = (half_v2(outnode[e->v2].radius) / half_v2(outnode[e->v1].radius));
-    radrat = (radrat + 1) / 2;
+    if (isfinite(radrat)) {
+      radrat = (radrat + 1) / 2;
+    }
+    else {
+      /* Happens when skin is scaled to zero. */
+      radrat = 1.0f;
+    }
 
     /* Add vertices and edge segments */
     for (j = 0; j < edge_subd[i]; j++, v++, outedge++) {



More information about the Bf-blender-cvs mailing list