glTF export: fix bone export when Yup is off

This commit is contained in:
Julien Duroure 2022-04-03 10:21:25 +02:00
parent b294d4c766
commit dfe74f0a1b
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -170,8 +170,10 @@ class VExportTree:
node.matrix_world @= correction.to_matrix().to_4x4()
elif node.blender_type == VExportNode.BONE:
node.matrix_world = self.nodes[node.armature].matrix_world @ blender_bone.matrix
axis_basis_change = Matrix(
((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
axis_basis_change = Matrix.Identity(4)
if self.export_settings[gltf2_blender_export_keys.YUP]:
axis_basis_change = Matrix(
((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
node.matrix_world = node.matrix_world @ axis_basis_change
# Force empty ?