[Bf-blender-cvs] [4df45e18dc1] blender2.8: Alembic: replaced BLI_assert() with comment why the assert is wrong

Sybren A. Stüvel noreply at git.blender.org
Fri Jun 8 15:53:35 CEST 2018


Commit: 4df45e18dc19fbf6ad6fd36e0f41723ec76d8c44
Author: Sybren A. Stüvel
Date:   Fri Jun 8 15:49:33 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4df45e18dc19fbf6ad6fd36e0f41723ec76d8c44

Alembic: replaced BLI_assert() with comment why the assert is wrong

The comment also hints at what should be fixed, instead.

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

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 6787d118fa1..53860ab149d 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -181,11 +181,11 @@ void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMod
 	unit_m3(dst_rot);
 	unit_m4(dst_scale_mat);
 
-	/* We assume there is no sheer component and no homogeneous scaling component. */
-	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);
+	/* TODO(Sybren): This code assumes there is no sheer component and no
+	 * homogeneous scaling component, which is not always true when writing
+	 * non-hierarchical (e.g. flat) objects (e.g. when parent has non-uniform
+	 * scale and the child rotates). This is currently not taken into account
+	 * when axis-swapping. */
 
 	/* 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