diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2017-04-03 11:48:00 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2017-04-03 11:48:00 +0300 |
commit | 368b74315a58f66187b924cbc646abd05ce6a2b7 (patch) | |
tree | ff14725d78e3e9ca13cd4255b48ae2ad218d0f71 /source/blender/collada | |
parent | f65d6ea95458ad53715f09165d37f2486e4750be (diff) |
Collada - add flag to limit precision of exported data, mainly to simplify debugging
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/ControllerExporter.cpp | 3 | ||||
-rw-r--r-- | source/blender/collada/ExportSettings.h | 1 | ||||
-rw-r--r-- | source/blender/collada/collada.cpp | 6 | ||||
-rw-r--r-- | source/blender/collada/collada.h | 1 |
5 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 49722873a91..9348f3b3285 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -304,7 +304,9 @@ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW: } } - bc_sanitize_mat(mat, 6); // XXX: Make this optional ? + if (this->export_settings->limit_precision) + bc_sanitize_mat(mat, 6); + TransformWriter::add_node_transform(node, mat, NULL); } diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index 5444c9dfa6b..1c2642e8313 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -533,7 +533,8 @@ std::string ControllerExporter::add_inv_bind_mats_source(Object *ob_arm, ListBas invert_m4_m4(mat, world); converter.mat4_to_dae(inv_bind_mat, mat); - bc_sanitize_mat(inv_bind_mat, 6); // XXX: Make this optional ? + if (this->export_settings->limit_precision) + bc_sanitize_mat(inv_bind_mat, 6); source.appendValues(inv_bind_mat); } } diff --git a/source/blender/collada/ExportSettings.h b/source/blender/collada/ExportSettings.h index 03e380dc198..de91f68a492 100644 --- a/source/blender/collada/ExportSettings.h +++ b/source/blender/collada/ExportSettings.h @@ -53,6 +53,7 @@ public: BC_export_transformation_type export_transformation_type; bool open_sim; + bool limit_precision; bool keep_bind_info; char *filepath; diff --git a/source/blender/collada/collada.cpp b/source/blender/collada/collada.cpp index bf3fcf0c3f0..bfe3180909b 100644 --- a/source/blender/collada/collada.cpp +++ b/source/blender/collada/collada.cpp @@ -90,7 +90,7 @@ int collada_export(Scene *sce, int sort_by_name, BC_export_transformation_type export_transformation_type, int open_sim, - + int limit_precision, int keep_bind_info) { ExportSettings export_settings; @@ -116,8 +116,8 @@ int collada_export(Scene *sce, export_settings.sort_by_name = sort_by_name != 0; export_settings.export_transformation_type = export_transformation_type; export_settings.open_sim = open_sim != 0; - - export_settings.keep_bind_info = keep_bind_info; + export_settings.limit_precision = limit_precision != 0; + export_settings.keep_bind_info = keep_bind_info !=0; int includeFilter = OB_REL_NONE; if (export_settings.include_armatures) includeFilter |= OB_REL_MOD_ARMATURE; diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h index 09acc4a064b..8035af59c8b 100644 --- a/source/blender/collada/collada.h +++ b/source/blender/collada/collada.h @@ -85,6 +85,7 @@ int collada_export(struct Scene *sce, BC_export_transformation_type export_transformation_type, int open_sim, + int limit_precision, int keep_bind_info); #ifdef __cplusplus |