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>2021-09-15 18:34:32 +0300
committerJulien Duroure <julien.duroure@gmail.com>2021-09-15 18:34:32 +0300
commit29c9aa34754494bc478a08f0be60f38f4844a83d (patch)
tree59cd0f15ca95a01d5ae0a42bec7a5e21ca31ba9f
parent4d562682c099ce740d705893008a91a30a206710 (diff)
glTF exporter: cleanup: use inverted_safe on matrices
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_extract.py10
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py2
5 files changed, 9 insertions, 9 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 7885987e..9e5bc6a7 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, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 7, 25),
+ "version": (1, 7, 26),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
index dc508d18..f7318c2b 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
@@ -387,7 +387,7 @@ def __get_positions(blender_mesh, key_blocks, armature, blender_object, export_s
# Transform for skinning
if armature and blender_object:
- apply_matrix = armature.matrix_world.inverted() @ blender_object.matrix_world
+ apply_matrix = armature.matrix_world.inverted_safe() @ blender_object.matrix_world
loc_transform = armature.matrix_world @ apply_matrix
loc_transform = blender_object.matrix_world
@@ -427,8 +427,8 @@ def __get_normals(blender_mesh, key_blocks, armature, blender_object, export_set
# Transform for skinning
if armature and blender_object:
- apply_matrix = (armature.matrix_world.inverted() @ blender_object.matrix_world)
- apply_matrix = apply_matrix.to_3x3().inverted().transposed()
+ apply_matrix = (armature.matrix_world.inverted_safe() @ blender_object.matrix_world)
+ apply_matrix = apply_matrix.to_3x3().inverted_safe().transposed()
normal_transform = armature.matrix_world.to_3x3() @ apply_matrix
normals[:] = __apply_mat_to_all(normal_transform, normals)
@@ -463,7 +463,7 @@ def __get_tangents(blender_mesh, armature, blender_object, export_settings):
# Transform for skinning
if armature and blender_object:
- apply_matrix = armature.matrix_world.inverted() @ blender_object.matrix_world
+ apply_matrix = armature.matrix_world.inverted_safe() @ blender_object.matrix_world
tangent_transform = apply_matrix.to_quaternion().to_matrix()
tangents = __apply_mat_to_all(tangent_transform, tangents)
__normalize_vecs(tangents)
@@ -482,7 +482,7 @@ def __get_bitangent_signs(blender_mesh, armature, blender_object, export_setting
if armature and blender_object:
# Bitangent signs should flip when handedness changes
# TODO: confirm
- apply_matrix = armature.matrix_world.inverted() @ blender_object.matrix_world
+ apply_matrix = armature.matrix_world.inverted_safe() @ blender_object.matrix_world
tangent_transform = apply_matrix.to_quaternion().to_matrix()
flipped = tangent_transform.determinant() < 0
if flipped:
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
index d3b9e022..aca85e07 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
@@ -370,7 +370,7 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve],
correction_matrix_local = axis_basis_change @ bone.bone.matrix_local
else:
correction_matrix_local = (
- bone.parent.bone.matrix_local.inverted() @
+ bone.parent.bone.matrix_local.inverted_safe() @
bone.bone.matrix_local
)
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py
index 2acf56dd..1abe9ec1 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py
@@ -40,7 +40,7 @@ def gather_joint(blender_object, blender_bone, export_settings):
correction_matrix_local = axis_basis_change @ blender_bone.bone.matrix_local
else:
correction_matrix_local = (
- blender_bone.parent.bone.matrix_local.inverted() @
+ blender_bone.parent.bone.matrix_local.inverted_safe() @
blender_bone.bone.matrix_local
)
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py
index 003a4d6f..5d9e31ed 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py
@@ -90,7 +90,7 @@ def __gather_inverse_bind_matrices(blender_object, export_settings):
blender_object.matrix_world @
bone.bone.matrix_local
)
- ).inverted()
+ ).inverted_safe()
matrices.append(inverse_bind_matrix)
if export_settings['gltf_def_bones'] is False: