[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49783] branches/soc-2012-bratwurst/source /blender/collada: [COLLADA] Morph animation export intro.
Sukhitha Jayathilake
pr.jayathilake at gmail.com
Fri Aug 10 23:17:20 CEST 2012
Revision: 49783
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49783
Author: phabtar
Date: 2012-08-10 21:17:20 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
[COLLADA] Morph animation export intro.
Modified Paths:
--------------
branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp
branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h
Modified: branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp 2012-08-10 21:14:13 UTC (rev 49782)
+++ branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.cpp 2012-08-10 21:17:20 UTC (rev 49783)
@@ -86,6 +86,8 @@
}
export_object_constraint_animation(ob);
+
+ export_morph_animation(ob);
//Export Lamp parameter animations
if ( (ob->type == OB_LAMP) && ((Lamp *)ob->data)->adt && ((Lamp *)ob->data)->adt->action) {
@@ -143,7 +145,8 @@
}
-void AnimationExporter::export_object_constraint_animation(Object *ob){
+void AnimationExporter::export_object_constraint_animation(Object *ob)
+{
std::vector<float> fra;
//Takes frames of target animations
make_anim_frames_from_targets(ob, fra);
@@ -152,6 +155,27 @@
dae_baked_object_animation(fra, ob);
}
+void AnimationExporter::export_morph_animation(Object *ob)
+{
+ FCurve *fcu;
+ char *transformName;
+ Key *key = ob_get_key(ob);
+ if(!key) return;
+
+ if(key->adt && key->adt->action){
+ fcu = (FCurve *)key->adt->action->curves.first;
+
+ while (fcu) {
+ transformName = extract_transform_name(fcu->rna_path);
+
+ dae_animation(ob, fcu, transformName, true);
+
+ fcu = fcu->next;
+ }
+ }
+
+}
+
void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<float> &frames ){
ListBase *conlist = get_active_constraints(ob);
Modified: branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h 2012-08-10 21:14:13 UTC (rev 49782)
+++ branches/soc-2012-bratwurst/source/blender/collada/AnimationExporter.h 2012-08-10 21:17:20 UTC (rev 49783)
@@ -113,6 +113,8 @@
void export_object_constraint_animation(Object *ob);
+ void export_morph_animation(Object *ob);
+
void write_bone_animation_matrix(Object *ob_arm, Bone *bone);
void write_bone_animation(Object *ob_arm, Bone *bone);
More information about the Bf-blender-cvs
mailing list