[Bf-blender-cvs] [d1f0bdd3377] master: fix: Collada Matrixdata Importer tried to fix rotations where nothing was to fix. The matrixdata import is now only doing a matrix decompose and then pplies the decomposed values to 3 trans-, 3 scale- and 4 rot-curves)

Gaia Clary noreply at git.blender.org
Tue Feb 27 17:03:07 CET 2018


Commit: d1f0bdd3377e2427aac3604e9f9963efedfa51d3
Author: Gaia Clary
Date:   Tue Feb 27 17:02:37 2018 +0100
Branches: master
https://developer.blender.org/rBd1f0bdd3377e2427aac3604e9f9963efedfa51d3

fix: Collada Matrixdata Importer tried to fix rotations where nothing was to fix. The matrixdata import is now only doing a matrix decompose and then pplies the decomposed values to 3 trans-, 3 scale- and 4 rot-curves)

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

M	source/blender/collada/AnimationImporter.cpp

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

diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index bc91b94afd9..ed3d953166f 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -764,7 +764,6 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
 			axis = i - 7;
 		}
 
-
 		if (is_joint)
 			BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
 		else
@@ -780,8 +779,8 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
 
 	std::vector<float>::iterator it;
 
-	float qref[4];
-	unit_qt(qref);
+	//float qref[4];
+	//unit_qt(qref);
 
 	// sample values at each frame
 	for (it = frames.begin(); it != frames.end(); it++) {
@@ -817,17 +816,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
 		}
 
 		float rot[4], loc[3], scale[3];
-
-		bc_rotate_from_reference_quat(rot, qref, mat);
-		copy_qt_qt(qref, rot);
-
-#if 0
-		for (int i = 0 ; i < 4;  i++) {
-			rot[i] = RAD2DEGF(rot[i]);
-		}
-#endif
-		copy_v3_v3(loc, mat[3]);
-		mat4_to_size(scale, mat);
+		mat4_decompose(loc, rot, scale, mat);
 
 		// add keys
 		for (int i = 0; i < totcu; i++) {
@@ -1854,12 +1843,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
 					}
 					fcurve_is_used(*it);
 				}
-
-				COLLADAFW::Matrix tm(matrix);
-				dae_matrix_to_mat4(&tm, mat);
-
-				std::vector<FCurve *>::iterator it;
-
+				unit_converter->dae_matrix_to_mat4_(mat, matrix);
 				return true;
 			}
 		}



More information about the Bf-blender-cvs mailing list