[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57189] trunk/blender/release/scripts/ freestyle/style_modules/parameter_editor.py: Fix for potential division by zero during Freestyle stroke rendering.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun Jun 2 13:42:04 CEST 2013


Revision: 57189
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57189
Author:   kjym3
Date:     2013-06-02 11:42:04 +0000 (Sun, 02 Jun 2013)
Log Message:
-----------
Fix for potential division by zero during Freestyle stroke rendering.
Problem report by Light BWK through personal communications with a
sample .blend file for reproducing the problem.  Thanks!

Modified Paths:
--------------
    trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py

Modified: trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py
===================================================================
--- trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py	2013-06-02 04:09:29 UTC (rev 57188)
+++ trunk/blender/release/scripts/freestyle/style_modules/parameter_editor.py	2013-06-02 11:42:04 UTC (rev 57189)
@@ -184,7 +184,7 @@
         p = it.object.point
         distance += (prev - p).length
         prev = p.copy() # need a copy because the point can be altered
-        t = min(distance / total, 1.0)
+        t = min(distance / total, 1.0) if total > 0.0 else 0.0
         yield it, t
         it.increment()
 




More information about the Bf-blender-cvs mailing list