[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1626] trunk/py/scripts/addons: fix for [#26148] Anomaly in bvh import

Campbell Barton ideasman42 at gmail.com
Mon Feb 21 01:11:51 CET 2011


Revision: 1626
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1626
Author:   campbellbarton
Date:     2011-02-21 00:11:50 +0000 (Mon, 21 Feb 2011)
Log Message:
-----------
fix for [#26148] Anomaly in bvh import
zero length bones had their tail offset in the wrong direction.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_anim_bvh/import_bvh.py
    trunk/py/scripts/addons/io_curve_svg/import_svg.py
    trunk/py/scripts/addons/render_povray/render.py

Modified: trunk/py/scripts/addons/io_anim_bvh/import_bvh.py
===================================================================
--- trunk/py/scripts/addons/io_anim_bvh/import_bvh.py	2011-02-20 23:29:51 UTC (rev 1625)
+++ trunk/py/scripts/addons/io_anim_bvh/import_bvh.py	2011-02-21 00:11:50 UTC (rev 1626)
@@ -263,6 +263,7 @@
 
         # Make sure tail isnt the same location as the head.
         if (bvh_node.rest_tail_local - bvh_node.rest_head_local).length <= 0.001 * global_scale:
+            print("\tzero length node found:", bvh_node.name)
             bvh_node.rest_tail_local.y = bvh_node.rest_tail_local.y + global_scale / 10
             bvh_node.rest_tail_world.y = bvh_node.rest_tail_world.y + global_scale / 10
 
@@ -383,10 +384,11 @@
 
         # ZERO AREA BONES.
         if (bone.head - bone.tail).length < 0.001:
+            print("\tzero length bone found:", bone.name)
             if bvh_node.parent:
                 ofs = bvh_node.parent.rest_head_local - bvh_node.parent.rest_tail_local
                 if ofs.length:  # is our parent zero length also?? unlikely
-                    bone.tail = bone.tail + ofs
+                    bone.tail = bone.tail - ofs
                 else:
                     bone.tail.y = bone.tail.y + average_bone_length
             else:

Modified: trunk/py/scripts/addons/io_curve_svg/import_svg.py
===================================================================
--- trunk/py/scripts/addons/io_curve_svg/import_svg.py	2011-02-20 23:29:51 UTC (rev 1625)
+++ trunk/py/scripts/addons/io_curve_svg/import_svg.py	2011-02-21 00:11:50 UTC (rev 1626)
@@ -111,7 +111,6 @@
 
         if node.getAttribute('height'):
             h = SVGParseCoord(node.getAttribute('height'), h)
-    
 
     return (w, h)
 

Modified: trunk/py/scripts/addons/render_povray/render.py
===================================================================
--- trunk/py/scripts/addons/render_povray/render.py	2011-02-20 23:29:51 UTC (rev 1625)
+++ trunk/py/scripts/addons/render_povray/render.py	2011-02-21 00:11:50 UTC (rev 1626)
@@ -23,7 +23,6 @@
 import os
 import sys
 import time
-import math
 from math import atan, pi, degrees, sqrt
 
 import platform as pltfrm
@@ -1573,7 +1572,6 @@
 
     def _export(self, scene, povPath, renderImagePath):
         import tempfile
-        import os
 
         if scene.pov_tempfiles_enable:
             self._temp_file_in = tempfile.NamedTemporaryFile(suffix=".pov", delete=False).name



More information about the Bf-extensions-cvs mailing list