From 919ab638a713be72950c1a016c5e7ce821d82df1 Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Thu, 28 Jul 2011 05:41:22 +0000
Subject: [PATCH] fix [#27896] B258.0 > X3D export > 2 bugs: Lib Groups,
 Rotation 0 0 0 0 bug #2, zero length axis.

---
 io_scene_x3d/export_x3d.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 7326d9d09..81c29b044 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -240,7 +240,7 @@ def export(file,
         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 @@ def export(file,
         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
-- 
GitLab