diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-02-27 19:53:53 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-02-27 19:53:53 +0300 |
commit | 1a65168c4202a76cfacaafb6c1175b56d82d7123 (patch) | |
tree | e62fb26b5e5f2333fc3a20e1318e7fcb4d221b43 /source/blender/collada | |
parent | 925f2280e6b65f7bbdaa50439b983e9ef853ff1a (diff) | |
parent | 05b5958a7a3bc112695bb9f63728260d595a51f4 (diff) |
merge Collada changtes from master
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 9 | ||||
-rw-r--r-- | source/blender/collada/AnimationExporter.h | 1 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 24 |
3 files changed, 6 insertions, 28 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 684575bfc08..1196b3dfbe8 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -214,19 +214,15 @@ void AnimationExporter::export_sampled_matrix_animation(Object *ob, std::vector< for (std::vector<float>::iterator ctime = ctimes.begin(); ctime != ctimes.end(); ++ctime) { float fmat[4][4]; - float outmat[4][4]; bc_update_scene(eval_ctx, scene, *ctime); BKE_object_matrix_local_get(ob, fmat); - - converter.mat4_to_dae(outmat, fmat); - if (this->export_settings->limit_precision) - bc_sanitize_mat(outmat, 6); + bc_sanitize_mat(fmat, 6); for (int i = 0; i < 4; i++) for (int j = 0; j < 4; j++) - values.push_back(outmat[j][i]); + values.push_back(fmat[i][j]); } std::string ob_name = id_name(ob); @@ -252,7 +248,6 @@ void AnimationExporter::export_sampled_transrotloc_animation(Object *ob, std::ve float feul[3]; bc_update_scene(eval_ctx, scene, *ctime); - BKE_object_matrix_local_get(ob, fmat); mat4_decompose(floc, fquat, fsize, fmat); quat_to_eul(feul, fquat); diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index 1e0f434ca13..b324b4c25f8 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -201,6 +201,5 @@ protected: bool validateConstraints(bConstraint *con); - //void calc_obmat_at_time(Object *ob, float ctime); }; diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 48fb27bc533..4ef256fbcf1 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; } } |