Identify material Animations to export.
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Sun, 17 Jul 2011 17:30:41 +0000 (17:30 +0000)
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Sun, 17 Jul 2011 17:30:41 +0000 (17:30 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationExporter.h

index 2072b1df7a84c8bc4412410d1d3dd037e99ac98a..81dae09731592bf5121ee0735a2379da5b020f53 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "GeometryExporter.h"
 #include "AnimationExporter.h"
+#include "MaterialExporter.h"
 
 template<class Functor>
 void forEachObjectInScene(Scene *sce, Functor &f)
@@ -944,7 +945,17 @@ void AnimationExporter::exportAnimations(Scene *sce)
                                fcu = (FCurve*)(((Lamp*)ob ->data)->adt->action->curves.first);
                        else if( (ob->type == OB_CAMERA ) && ((Camera*)ob ->data)->adt && ((Camera*)ob ->data)->adt->action )
                                fcu = (FCurve*)(((Camera*)ob ->data)->adt->action->curves.first);
-                       //The Scene has animations if object type is armature or object has f-curve or object is a Lamp which has f-curves
+                       
+                   for(int a = 0; a < ob->totcol; a++)
+                       {
+                               Material *ma = give_current_material(ob, a+1);
+                               if (!ma) continue;
+                               if(ma->adt && ma->adt->action)
+                               {
+                                       fcu = (FCurve*)ma->adt->action->curves.first;   
+                               }
+                       }
+
                        if ( fcu) return true;
                        base= base->next;
                }
index 481cacbd4c8463c8c3b23a25ef30fa8ab2b92786..5185458d71c8a70fc822866dab6cf60f0e43c9e6 100644 (file)
@@ -35,6 +35,7 @@ extern "C"
 #include "DNA_lamp_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_armature_types.h"
+#include "DNA_material_types.h"
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_fcurve.h"
@@ -68,6 +69,8 @@ extern char build_rev[];
 #include "COLLADASWConstants.h"
 #include "COLLADASWBaseInputElement.h"
 
+#include "EffectExporter.h"
+
 #include "collada_internal.h"
 
 #include <vector>