diff options
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py')
-rw-r--r-- | io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py index ba63e049..0377a6b7 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py @@ -163,10 +163,16 @@ class VExportTree: # So real world matrix is collection world_matrix @ "world_matrix" of object node.matrix_world = parent_coll_matrix_world @ blender_object.matrix_world.copy() if node.blender_type == VExportNode.CAMERA and self.export_settings[gltf2_blender_export_keys.CAMERAS]: - correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + if self.export_settings[gltf2_blender_export_keys.YUP]: + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + else: + correction = Matrix.Identity(4).to_quaternion() node.matrix_world @= correction.to_matrix().to_4x4() elif node.blender_type == VExportNode.LIGHT and self.export_settings[gltf2_blender_export_keys.LIGHTS]: - correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + if self.export_settings[gltf2_blender_export_keys.YUP]: + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + else: + correction = Matrix.Identity(4).to_quaternion() node.matrix_world @= correction.to_matrix().to_4x4() elif node.blender_type == VExportNode.BONE: if self.export_settings['gltf_current_frame'] is True: |