Revision: 21164
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21164
Author:   campbellbarton
Date:     2009-06-26 04:49:47 +0200 (Fri, 26 Jun 2009)

Log Message:
-----------
bugfix [#18949] bvh import does not do single rigid bodies
these BVH files are not that common but may as well support it.

Modified Paths:
--------------
    trunk/blender/release/scripts/bvh_import.py

Modified: trunk/blender/release/scripts/bvh_import.py
===================================================================
--- trunk/blender/release/scripts/bvh_import.py 2009-06-26 02:22:53 UTC (rev 
21163)
+++ trunk/blender/release/scripts/bvh_import.py 2009-06-26 02:49:47 UTC (rev 
21164)
@@ -277,12 +277,17 @@
        for bvh_node in bvh_nodes.itervalues():
                
                if not bvh_node.rest_tail_world:
-                       if len(bvh_node.children)==1:
+                       if len(bvh_node.children)==0:
+                               # could just fail here, but rare BVH files have 
childless nodes
+                               bvh_node.rest_tail_world = 
Vector(bvh_node.rest_head_world)
+                               bvh_node.rest_tail_local = 
Vector(bvh_node.rest_head_local)
+                       elif len(bvh_node.children)==1:
                                bvh_node.rest_tail_world= 
Vector(bvh_node.children[0].rest_head_world)
                                bvh_node.rest_tail_local= 
Vector(bvh_node.children[0].rest_head_local)
                        else:
-                               if not bvh_node.children:
-                                       raise 'error, bvh node has no end and 
no children. bad file'
+                               # allow this, see above
+                               #if not bvh_node.children:
+                               #       raise 'error, bvh node has no end and 
no children. bad file'
                                        
                                # Removed temp for now
                                rest_tail_world= Vector(0,0,0)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to