[Bf-extensions-cvs] [2b04a1ab] master: glTF importer: fix import of bone rest pose of negative scaled bones

Julien Duroure noreply at git.blender.org
Wed Nov 13 22:24:13 CET 2019


Commit: 2b04a1ab68290e35978fe484778a443ee8b3b7ee
Author: Julien Duroure
Date:   Wed Nov 13 22:22:53 2019 +0100
Branches: master
https://developer.blender.org/rBA2b04a1ab68290e35978fe484778a443ee8b3b7ee

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

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/imp/gltf2_blender_skin.py

===================================================================

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()



More information about the Bf-extensions-cvs mailing list