Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-11-14 00:22:53 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-11-14 00:22:53 +0300
commit2b04a1ab68290e35978fe484778a443ee8b3b7ee (patch)
tree561aba327e77c28deb568ab66b27c8fad60bb641 /io_scene_gltf2
parent78fe8ec049fa3242bbbc2db5faed297e36374993 (diff)
glTF importer: fix import of bone rest pose of negative scaled bones
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_skin.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 3a048afe..eb7e130c 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -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',
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_skin.py b/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
index 9c8cd168..0f512188 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
@@ -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()