diff options
Diffstat (limited to 'io_scene_gltf2/blender')
4 files changed, 8 insertions, 8 deletions
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: |