Material diffuse color animation COLLADA export.
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Wed, 27 Jul 2011 18:38:44 +0000 (18:38 +0000)
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Wed, 27 Jul 2011 18:38:44 +0000 (18:38 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp

index 640a4b36384707cbd3bef9de33a67b520b48c191..a4ff987d9eae99b0b28c2dc31485dbb71093f753 100644 (file)
@@ -111,7 +111,8 @@ void AnimationExporter::exportAnimations(Scene *sce)
                                while (fcu) {
                                        transformName = extract_transform_name( fcu->rna_path );
                                        
-                                       if ((!strcmp(transformName, "specular_hardness"))||(!strcmp(transformName, "specular_color"))) 
+                                       if ((!strcmp(transformName, "specular_hardness"))||(!strcmp(transformName, "specular_color"))
+                                               ||(!strcmp(transformName, "diffuse"))) 
                                                dae_animation(ob ,fcu, transformName, true, ma );
                                        fcu = fcu->next;
                                }
@@ -204,7 +205,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
                        axis_name = axis_names[fcu->array_index];*/
                }
                //maybe a list or a vector of float animations
-               else if ( !strcmp(transformName, "color")||!strcmp(transformName, "specular_color") )
+               else if ( !strcmp(transformName, "color")||!strcmp(transformName, "specular_color")||!strcmp(transformName, "diffuse_color"))
                {
                        const char *axis_names[] = {"R", "G", "B"};
                        if (fcu->array_index < 3)
@@ -842,6 +843,8 @@ void AnimationExporter::exportAnimations(Scene *sce)
                                tm_type = 11;
                        else if (!strcmp(name, "specular_color"))
                                tm_type = 12;
+                       else if (!strcmp(name, "diffuse_color"))
+                               tm_type = 13;
                        
                        else
                                tm_type = -1;
@@ -886,7 +889,9 @@ void AnimationExporter::exportAnimations(Scene *sce)
                case 12:
                        tm_name = "specular";
                        break;
-                       
+               case 13:
+                       tm_name = "diffuse";
+                       break;  
                default:
                        tm_name = "";
                        break;
index 60c0308a7bccb18fcb779215c5bafc0563a4588f..3e56b3fb57eb26f38d41ae20eb02498cc0c708c4 100644 (file)
@@ -844,33 +844,21 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
                        {
                                const COLLADAFW::Color *col =  &(light->getColor());
                                const COLLADAFW::UniqueId& listid = col->getAnimationList();
-                               //transformation has animations
-                               //const COLLADAFW::AnimationList *animlist = animlist_map[listid];
-                               //const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings();
-                               ////all the curves belonging to the current binding
-                               //std::vector<FCurve*> animcurves;    
-                               //for (unsigned int j = 0; j < bindings.getCount(); j++) {
-                               //       animcurves = curve_map[bindings[j].animation];
-                               //      //calculate rnapaths and array index of fcurves according to transformation and animation class
+                               
                                Assign_color_animations(listid, AnimCurves, "color"); 
-                                       
-                                //std::vector<FCurve*>::iterator iter;
-                                       ////Add the curves of the current animation to the object
-                                       //for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
-                                       //      FCurve * fcu = *iter;
-                                       //      BLI_addtail(AnimCurves, fcu);   
-                                       //}                             
                        }
                        if ((animType->light & LIGHT_FOA) != 0 )
                        {
                                const COLLADAFW::AnimatableFloat *foa =  &(light->getFallOffAngle());
                                const COLLADAFW::UniqueId& listid = foa->getAnimationList();
+                               
                                Assign_float_animations( listid ,AnimCurves, "spot_size"); 
                        }
                        if ( (animType->light & LIGHT_FOE) != 0 )
                        {
                                const COLLADAFW::AnimatableFloat *foe =  &(light->getFallOffExponent());
                                const COLLADAFW::UniqueId& listid = foe->getAnimationList();
+                               
                                Assign_float_animations( listid ,AnimCurves, "spot_blend"); 
                        
                        }