Commit Graph

10 Commits

Author SHA1 Message Date
3df470fc62 Refactor: Collada: Moved collada related function out of the BCAnimationCurve class
I want to make BCAnimationCurve more general so it potentially can later
also be used from other exporters as well.
2018-08-02 17:49:42 +02:00
51a76657de Feature: Collada Object->data FCurves can now also be sampled 2018-08-02 17:49:38 +02:00
e04a73c993 Refactor: Use more general appraoch to get data from BCMatrix
Added virtual function get_value_for() that can pick the correct data
from a Matrix (and later also for a vector or a float array) (wip)

this is in preparation for adding Sample data for Materials, light and camera
Those animations do not need matrix values, but either simple float arrays
or float vector arrays. I still want to handle those animation samples
in the same way as the Matrix samples. So i try to use a class hierarchy here
with the base class BCSample and derived classes where BCMatrix is the only
implemented subclass so far. (wip)
2018-08-02 17:37:35 +02:00
d0055996a7 Removed the "See Also" line from the license comments 2018-08-02 17:37:34 +02:00
237da1869a Fixed File Copyright blocks in file headers 2018-08-02 17:37:33 +02:00
ec1ed2a9f9 Added separate functions to get curve data for sampling and keyframes
For Materials, Camera, Lamp actions it turned out that the sampler
can not sample the data at the moment. So for those curves i need
to get the data from the original curves for now. I Added a getter
that would retreive the data from the FCurve instead from the sampled
data if no sampled data is available. This will change (wip)

Known limitation: the Material,Lamp,Camera actions are always
exported with linear interpolation (wip)
2018-08-02 17:37:33 +02:00
3ce6ff90b7 First stable version of new Collada Animation Exporter.
This still needs cleanup and fixing (wip)
2018-08-02 17:37:32 +02:00
bcbcc292f3 Cleanup: Collada added indentation, changed variable names
Just for better reading, no functional change here.
2018-08-02 14:50:35 +02:00
26f6e3a977 Feature: Collada: Added new classes for The Animation exporter
Actually the new classes are not depending on Collada itself.
They coul dbe reused for other purposes as well, for example
as a general helper tool for Animation export.
2018-08-02 14:34:53 +02:00
02f0b09329 Refactor Collada: Moved Classes into separate files
Renamed AnimationCurveCache to BCAnimationCurveContainer
because this is really not a cache but just a set of Data that
prepares the export of FCurves. This container only lives during
export and is otherwiose not used for anything else.

The BCAnimationCurveContainer is not depending on Collada in any way.
Theoretically it could be used also from Python, but this is another story.

Additions in more detail:

Classes:

* BCAnimationCurve
  a wrapper for handling FCurves tied to an object within the
  Animation Exporter

* BCAnimationCurveContainer
  A container to keep all FCurves in one place. It also maintains
  creation and deletion of temporary FCurves needed to export data
  without interfering with the User's production data in Blender.

* BCMatrix
  Handy class for making float mat[4][4] a primetime resident in
  the code. Not necessary but nice.

Support functions:

* bc_get_children(std::vector<Object *> &child_set, Object *ob, Scene *scene)
  returns the immediate children of an object into a set

* bc_string_after(const std::string& s, const char c)
  returns the string after the last occurance of char

* bc_startswith(std::string const & value, std::string const & starting)
  returns true if the string starts with the starting sequence

* bc_endswith(std::string const & value, std::string const & ending)
  returns true if the string ends with the ending sequence
2018-08-02 14:34:53 +02:00