From 12f80524edf7fc6b0882c52310264231e04d5451 Mon Sep 17 00:00:00 2001 From: Alexander N <alpha-beta-release@gmx.net> Date: Sun, 10 Feb 2013 00:25:03 +0000 Subject: [PATCH] fix: potentially division by zero in case of no weights --- io_scene_ms3d/__init__.py | 2 +- io_scene_ms3d/ms3d_export.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/io_scene_ms3d/__init__.py b/io_scene_ms3d/__init__.py index 4f51ef69a..c73b0a8d2 100644 --- a/io_scene_ms3d/__init__.py +++ b/io_scene_ms3d/__init__.py @@ -23,7 +23,7 @@ bl_info = { 'description': "Import / Export MilkShape3D MS3D files"\ " (conform with MilkShape3D v1.8.4)", 'author': "Alexander Nussbaumer", - 'version': (0, 95, 0), + 'version': (0, 95, 1), 'blender': (2, 65, 3), 'location': "File > Import & File > Export", 'warning': "", diff --git a/io_scene_ms3d/ms3d_export.py b/io_scene_ms3d/ms3d_export.py index 5f256a8d5..b48ee2714 100644 --- a/io_scene_ms3d/ms3d_export.py +++ b/io_scene_ms3d/ms3d_export.py @@ -392,7 +392,10 @@ class Ms3dExporter(): for weight in weights: weight_sum += weight - weight_normalize = 1.0 / weight_sum + if weight_sum > 0.0: + weight_normalize = 1.0 / weight_sum + else: + weight_normalize = 1.0 weight_sum = 1.0 for index, weight in enumerate(weights): -- GitLab