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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-13 16:51:21 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-13 16:51:21 +0300
commit765c84e507cc3c5ca7d788bf4de819ad8b1206a7 (patch)
tree0a8bf9bfa91bf6114107f59058190420fe051eac /io_scene_fbx/fbx_utils.py
parent9d276937de26f82a4bbaded388ed474b951f338a (diff)
Fix T42586: Error when attempting to export FBX (non-invertible matrix).
Just use 'new' inverted_safe() everywhere we are not 100% sure the matrix is invertible...
Diffstat (limited to 'io_scene_fbx/fbx_utils.py')
-rw-r--r--io_scene_fbx/fbx_utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index e8837fc9..be365791 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -902,11 +902,11 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
if self._tag == 'OB':
return self.bdata.matrix_local.copy()
elif self._tag == 'DP':
- return self._ref.matrix_world.inverted() * self._dupli_matrix
+ return self._ref.matrix_world.inverted_safe() * self._dupli_matrix
else: # 'BO', current pose
# PoseBone.matrix is in armature space, bring in back in real local one!
par = self.bdata.parent
- par_mat_inv = self._ref.pose.bones[par.name].matrix.inverted() if par else Matrix()
+ par_mat_inv = self._ref.pose.bones[par.name].matrix.inverted_safe() if par else Matrix()
return par_mat_inv * self._ref.pose.bones[self.bdata.name].matrix
matrix_local = property(get_matrix_local)
@@ -923,7 +923,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
if self._tag == 'BO':
# Bone.matrix_local is in armature space, bring in back in real local one!
par = self.bdata.parent
- par_mat_inv = par.matrix_local.inverted() if par else Matrix()
+ par_mat_inv = par.matrix_local.inverted_safe() if par else Matrix()
return par_mat_inv * self.bdata.matrix_local
else:
return self.matrix_local
@@ -1012,7 +1012,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
matrix = (parent.matrix_rest_local if rest else parent.matrix_local) * matrix
# ...and move it back into parent's *FBX* local space.
par_mat = parent.fbx_object_matrix(scene_data, rest=rest, local_space=True)
- matrix = par_mat.inverted() * matrix
+ matrix = par_mat.inverted_safe() * matrix
if self.use_bake_space_transform(scene_data):
# If we bake the transforms we need to post-multiply inverse global transform.