Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander N <alpha-beta-release@gmx.net>2013-02-10 04:25:03 +0400
committerAlexander N <alpha-beta-release@gmx.net>2013-02-10 04:25:03 +0400
commit12f80524edf7fc6b0882c52310264231e04d5451 (patch)
treeba3e0d462e1fbe45f1b49e7db44bd39babe11bde
parent110da24b010ce2f56f30dce60adadc103903c4bf (diff)
fix: potentially division by zero in case of no weights
-rw-r--r--io_scene_ms3d/__init__.py2
-rw-r--r--io_scene_ms3d/ms3d_export.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/io_scene_ms3d/__init__.py b/io_scene_ms3d/__init__.py
index 4f51ef69..c73b0a8d 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 5f256a8d..b48ee271 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):