[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38456] branches/soc-2011-pepper/source/ blender/collada: Identify material Animations to export.
Sukhitha Jayathilake
pr.jayathilake at gmail.com
Sun Jul 17 19:30:41 CEST 2011
Revision: 38456
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38456
Author: phabtar
Date: 2011-07-17 17:30:41 +0000 (Sun, 17 Jul 2011)
Log Message:
-----------
Identify material Animations to export.
Modified Paths:
--------------
branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
branches/soc-2011-pepper/source/blender/collada/AnimationExporter.h
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-17 17:26:32 UTC (rev 38455)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-17 17:30:41 UTC (rev 38456)
@@ -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 @@
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;
}
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.h 2011-07-17 17:26:32 UTC (rev 38455)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.h 2011-07-17 17:30:41 UTC (rev 38456)
@@ -35,6 +35,7 @@
#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 @@
#include "COLLADASWConstants.h"
#include "COLLADASWBaseInputElement.h"
+#include "EffectExporter.h"
+
#include "collada_internal.h"
#include <vector>
More information about the Bf-blender-cvs
mailing list