glTF exporter: make sure rotation are normalized

This commit is contained in:
Julien Duroure 2020-05-12 18:45:58 +02:00
parent 72227fc13b
commit fac4c6443b
2 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 3, 15),
"version": (1, 3, 16),
'blender': (2, 90, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -369,6 +369,9 @@ def __gather_trans_rot_scale(blender_object, export_settings):
rot = blender_object.rotation_euler.to_quaternion()
sca = blender_object.scale
# make sure the rotation is normalized
rot.normalize()
trans = gltf2_blender_extract.convert_swizzle_location(trans, None, None, export_settings)
rot = gltf2_blender_extract.convert_swizzle_rotation(rot, export_settings)
sca = gltf2_blender_extract.convert_swizzle_scale(sca, export_settings)