glTF importer: fix import of bone rest pose of negative scaled bones

This commit is contained in:
Julien Duroure 2019-11-13 22:22:53 +01:00
parent 78fe8ec049
commit 2b04a1ab68
2 changed files with 4 additions and 4 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, 1, 6),
"version": (1, 1, 7),
'blender': (2, 81, 6),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -96,10 +96,10 @@ class BlenderSkin():
obj.pose.bones[pynode.blender_bone_name].location = \
bind_rotation.inverted().to_matrix().to_4x4() @ final_location
# Do the same for rotation
# Do the same for rotation & scale
obj.pose.bones[pynode.blender_bone_name].rotation_quaternion = \
(bind_rotation.to_matrix().to_4x4().inverted() @ parent_mat @
rotation.to_matrix().to_4x4()).to_quaternion()
(pynode.blender_bone_matrix.inverted() @ parent_mat @
matrix_gltf_to_blender(pynode.transform)).to_quaternion()
obj.pose.bones[pynode.blender_bone_name].scale = \
(bind_scale.inverted() @ parent_mat @ scale_to_matrix(scale)).to_scale()