diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-05-23 13:17:17 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-05-23 13:29:20 +0300 |
commit | 6be9d19951ed460829d379aa90953b14a9f281f2 (patch) | |
tree | 45fe275c232ff0b4fb0e4e7205d53c8fdd6f8e9a /source/blender/collada/AnimationExporter.h | |
parent | e9cf9e0a397f9589e00d980f0c0489641e7ed57e (diff) |
Collada exporter update
Added new feature: Collada: global axis rotation upon export (UI)
The new feature allows to specify the target rest coordinate system upon export.
This allows for example to export a character that is in Blender orientation (Y forward)
to match the Secondlife orientation where (-X forward)
- Refactor:Added new utility methods to collada_utils
Made BCMatrix class more powerfull
moved Blender related structures into new BlenderContext class
added class wrapper to encapsulate ExportSettings structure
Added blender context getters to ExportSettings
added access methods to BlenderContext into ExportSettings class
Moved class BCMatrix into BlenderContext
moved utility functions from collada_util into BlenderContext
replace own function for parenting by a call to ED_object_parent_set()
- Cleanup: removed obsolete parameters from methods
renamed parameters for better understanding
cleanup whitespace and indentation
removed obsolete comments
Diffstat (limited to 'source/blender/collada/AnimationExporter.h')
-rw-r--r-- | source/blender/collada/AnimationExporter.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h index 71d7d14a112..27474cc2b58 100644 --- a/source/blender/collada/AnimationExporter.h +++ b/source/blender/collada/AnimationExporter.h @@ -86,20 +86,22 @@ typedef enum BC_animation_source_type { BC_SOURCE_TYPE_TIMEFRAME, } BC_animation_source_type; +typedef enum BC_global_rotation_type { + BC_NO_ROTATION, + BC_OBJECT_ROTATION, + BC_DATA_ROTATION +} BC_global_rotation_type; + class AnimationExporter : COLLADASW::LibraryAnimations { private: - BlenderContext &blender_context; COLLADASW::StreamWriter *sw; - const ExportSettings *export_settings; + BCExportSettings &export_settings; + + BC_global_rotation_type get_global_rotation_type(Object *ob); public: - AnimationExporter(BlenderContext &blender_context, - COLLADASW::StreamWriter *sw, - const ExportSettings *export_settings) - : COLLADASW::LibraryAnimations(sw), - blender_context(blender_context), - sw(sw), - export_settings(export_settings) + AnimationExporter(COLLADASW::StreamWriter *sw, BCExportSettings &export_settings) + : COLLADASW::LibraryAnimations(sw), sw(sw), export_settings(export_settings) { } @@ -176,14 +178,17 @@ class AnimationExporter : COLLADASW::LibraryAnimations { std::string name, std::string target, std::string axis, - BCAnimationCurve &curve); + BCAnimationCurve &curve, + BC_global_rotation_type global_rotation_type); /* call to the low level collada exporter */ void export_collada_matrix_animation(std::string id, std::string name, std::string target, BCFrames &frames, - BCMatrixSampleMap &outmats); + BCMatrixSampleMap &outmats, + BC_global_rotation_type global_rotation_type, + Matrix &parentinv); BCAnimationCurve *get_modified_export_curve(Object *ob, BCAnimationCurve &curve, @@ -202,7 +207,10 @@ class AnimationExporter : COLLADASW::LibraryAnimations { const std::string axis_name); /* Output sources (matrix data) */ - std::string collada_source_from_values(BCMatrixSampleMap &samples, const std::string &anim_id); + std::string collada_source_from_values(BCMatrixSampleMap &samples, + const std::string &anim_id, + BC_global_rotation_type global_rotation_type, + Matrix &parentinv); /* Interpolation sources */ std::string collada_linear_interpolation_source(int tot, const std::string &anim_id); |