[Bf-extensions-cvs] [bc1262f4] master: Fix T76303: Divide by zero importing X3D/WRL

Campbell Barton noreply at git.blender.org
Mon Jun 22 07:32:30 CEST 2020


Commit: bc1262f4d61feeba235bb75046e65e0e8411241f
Author: Campbell Barton
Date:   Mon Jun 22 15:31:45 2020 +1000
Branches: master
https://developer.blender.org/rBAbc1262f4d61feeba235bb75046e65e0e8411241f

Fix T76303: Divide by zero importing X3D/WRL

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

M	io_scene_x3d/import_x3d.py

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

diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 5a1a4b32..653b8d9f 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -2043,6 +2043,12 @@ def importMesh_IndexedFaceSet(geom, ancestry):
         t_min = mins[t_axis]
         dt = deltas[t_axis]
 
+        # Avoid divide by zero T76303.
+        if not (ds > 0.0):
+            ds = 1.0
+        if not (dt > 0.0):
+            dt = 1.0
+
         def generatePointCoords(pt):
             return (pt[s_axis] - s_min) / ds, (pt[t_axis] - t_min) / dt
         loops = [co for f in faces



More information about the Bf-extensions-cvs mailing list