[Bf-blender-cvs] [30514f0f81] temp-sybren-alembic: Alembic: more lenient check on absence of sheer & homogeneous scaling

Sybren A. Stüvel noreply at git.blender.org
Tue Feb 28 16:58:35 CET 2017


Commit: 30514f0f8138fd95897f5b396f148d9bd83c6a4f
Author: Sybren A. Stüvel
Date:   Tue Feb 28 16:42:25 2017 +0100
Branches: temp-sybren-alembic
https://developer.blender.org/rB30514f0f8138fd95897f5b396f148d9bd83c6a4f

Alembic: more lenient check on absence of sheer & homogeneous scaling

Checking precise values of floats is not a good idea.

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

M	source/blender/alembic/intern/abc_util.cc

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

diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc
index c3c380b534..49c806125c 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -176,10 +176,10 @@ void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMod
 	unit_m4(dst_scale_mat);
 
 	/* We assume there is no sheer component and no homogeneous scaling component. */
-	BLI_assert(src_mat[0][3] == 0.0);
-	BLI_assert(src_mat[1][3] == 0.0);
-	BLI_assert(src_mat[2][3] == 0.0);
-	BLI_assert(src_mat[3][3] == 1.0);
+	BLI_assert(fabs(src_mat[0][3]) < 2 * FLT_EPSILON);
+	BLI_assert(fabs(src_mat[1][3]) < 2 * FLT_EPSILON);
+	BLI_assert(fabs(src_mat[2][3]) < 2 * FLT_EPSILON);
+	BLI_assert(fabs(src_mat[3][3] - 1.0f) < 2 * FLT_EPSILON);
 
 	/* Extract translation, rotation, and scale form matrix. */
 	mat4_to_loc_rot_size(src_trans, src_rot, src_scale, src_mat);




More information about the Bf-blender-cvs mailing list