diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-02-26 18:34:45 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2018-02-26 19:16:56 +0300 |
commit | a024da55af09fb75e3b72489a8696878909bf676 (patch) | |
tree | cf9cfcccbba2323816a19647770e07d6b5d3c6e7 /source/blender/collada/collada_utils.cpp | |
parent | 5f9657316e4e53594643cf1bb128135a593bcae5 (diff) |
Adding support for Matrix Transformation export
The exporter does export matrix data (4*4 Transformation matrix) only for Skeletal animation. For object animation only exporting to trans/rot/loc is implemented.
This task implements Matrix export also for simple Object animation.
Differential Revision: https://developer.blender.org/D3082
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 9f984a33ed1..fcd92e220c0 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -144,6 +144,14 @@ EvaluationContext *bc_get_evaluation_context() return bmain->eval_ctx; } +void bc_update_scene(Scene *scene, float ctime) +{ + BKE_scene_frame_set(scene, ctime); + Main *bmain = bc_get_main(); + EvaluationContext *ev_context = bc_get_evaluation_context(); + BKE_scene_update_for_newframe(ev_context, bmain, scene, scene->lay); +} + Object *bc_add_object(Scene *scene, int type, const char *name) { Object *ob = BKE_object_add_only_object(G.main, type, name); @@ -883,6 +891,21 @@ void bc_sanitize_mat(double mat[4][4], int precision) mat[i][j] = double_round(mat[i][j], precision); } +void bc_copy_m4_farray(float r[4][4], float *a) +{ + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + r[i][j] = *a++; +} + +void bc_copy_farray_m4(float *r, float a[4][4]) +{ + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + *r++ = a[i][j]; + +} + /* * Returns name of Active UV Layer or empty String if no active UV Layer defined. * Assuming the Object is of type MESH |