[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2188] trunk/py/scripts/addons/ io_scene_x3d/export_x3d.py: fix [#27896] B258.0 > X3D export > 2 bugs: Lib Groups, Rotation 0 0 0 0

Campbell Barton ideasman42 at gmail.com
Thu Jul 28 07:41:23 CEST 2011


Revision: 2188
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2188
Author:   campbellbarton
Date:     2011-07-28 05:41:22 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
fix [#27896] B258.0 > X3D export > 2 bugs: Lib Groups, Rotation 0 0 0 0
bug #2, zero length axis.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_x3d/export_x3d.py

Modified: trunk/py/scripts/addons/io_scene_x3d/export_x3d.py
===================================================================
--- trunk/py/scripts/addons/io_scene_x3d/export_x3d.py	2011-07-27 16:26:34 UTC (rev 2187)
+++ trunk/py/scripts/addons/io_scene_x3d/export_x3d.py	2011-07-28 05:41:22 UTC (rev 2188)
@@ -240,7 +240,7 @@
         fw('DEF=%s\n' % view_id)
         fw(ident_step + 'centerOfRotation="0 0 0"\n')
         fw(ident_step + 'position="%3.2f %3.2f %3.2f"\n' % loc[:])
-        fw(ident_step + 'orientation="%3.2f %3.2f %3.2f %3.2f"\n' % (quat.axis[:] + (quat.angle, )))
+        fw(ident_step + 'orientation="%3.2f %3.2f %3.2f %3.2f"\n' % (quat.axis.normalized()[:] + (quat.angle, )))
         fw(ident_step + 'fieldOfView="%.3g"\n' % obj.data.angle)
         fw(ident_step + '/>\n')
 
@@ -283,7 +283,7 @@
         fw(ident_step + 'translation="%.6g %.6g %.6g"\n' % loc[:])
         # fw(ident_step + 'center="%.6g %.6g %.6g"\n' % (0, 0, 0))
         fw(ident_step + 'scale="%.6g %.6g %.6g"\n' % sca[:])
-        fw(ident_step + 'rotation="%.6g %.6g %.6g %.6g"\n' % (quat.axis[:] + (quat.angle, )))
+        fw(ident_step + 'rotation="%.6g %.6g %.6g %.6g"\n' % (quat.axis.normalized()[:] + (quat.angle, )))
         fw(ident_step + '>\n')
         ident += '\t'
         return ident



More information about the Bf-extensions-cvs mailing list