Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-08-07 22:15:40 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-08-07 22:15:40 +0400
commitc095397c988cd2ef6a956ce2742814ea2d3e7f0d (patch)
treecfd22caa8118463836a72754c95fbd178f8c96ff /source/blender/collada/AnimationExporter.cpp
parentdaab78bc614fdf19d1e56558972347121e82e06e (diff)
Armature bake animation export ( not as pose matrices. Still needs fixing )
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r--source/blender/collada/AnimationExporter.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 53f3cc9aae3..b1b26fa2915 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -367,7 +367,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
if (!pchan)
return;
- find_all_frames(ob_arm, fra);
+ find_frames(ob_arm, fra);
if (flag & ARM_RESTPOS) {
arm->flag &= ~ARM_RESTPOS;
@@ -1119,6 +1119,25 @@ void AnimationExporter::exportAnimations(Scene *sce)
return;
}
+
+ void AnimationExporter::find_frames(Object *ob, std::vector<float> &fra)
+ {
+ FCurve *fcu= (FCurve*)ob->adt->action->curves.first;
+
+ for (; fcu; fcu = fcu->next) {
+
+ for (unsigned int i = 0; i < fcu->totvert; i++) {
+ float f = fcu->bezt[i].vec[1][0]; //
+ if (std::find(fra.begin(), fra.end(), f) == fra.end())
+ fra.push_back(f);
+ }
+ }
+
+ // keep the keys in ascending order
+ std::sort(fra.begin(), fra.end());
+ }
+
+
void AnimationExporter::find_frames(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name)
{
FCurve *fcu= (FCurve*)ob->adt->action->curves.first;