Skip to content
Snippets Groups Projects
Commit d8258116 authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: Use rest pose for armature when 'use current frame' is off

parent fef8f1ff
No related branches found
No related tags found
No related merge requests found
......@@ -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, 32),
"version": (3, 2, 33),
'blender': (3, 1, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
......
......@@ -169,7 +169,12 @@ class VExportTree:
correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0))
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
if self.export_settings['gltf_current_frame'] is True:
# Use pose bone for TRS
node.matrix_world = self.nodes[node.armature].matrix_world @ blender_bone.matrix
else:
# Use edit bone for TRS --> REST pose will be used
node.matrix_world = self.nodes[node.armature].matrix_world @ blender_bone.bone.matrix_local
axis_basis_change = Matrix.Identity(4)
if self.export_settings[gltf2_blender_export_keys.YUP]:
axis_basis_change = Matrix(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment