Material Diffuse Color animation COLLADA import.
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Wed, 27 Jul 2011 19:08:18 +0000 (19:08 +0000)
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Wed, 27 Jul 2011 19:08:18 +0000 (19:08 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationImporter.cpp
source/blender/collada/AnimationImporter.h

index a4ff987..4c07b8c 100644 (file)
@@ -112,7 +112,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
                                        transformName = extract_transform_name( fcu->rna_path );
                                        
                                        if ((!strcmp(transformName, "specular_hardness"))||(!strcmp(transformName, "specular_color"))
-                                               ||(!strcmp(transformName, "diffuse"))) 
+                                               ||(!strcmp(transformName, "diffuse_color"))) 
                                                dae_animation(ob ,fcu, transformName, true, ma );
                                        fcu = fcu->next;
                                }
index 3e56b3f..dad10d9 100644 (file)
@@ -934,6 +934,12 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
                                        const COLLADAFW::UniqueId& listid =  cot->getColor().getAnimationList();
                                        Assign_color_animations( listid, AnimCurves , "specular_color" );
                                }
+                               
+                               if((animType->material & MATERIAL_DIFF_COLOR) != 0){
+                                       const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
+                                       const COLLADAFW::UniqueId& listid =  cot->getColor().getAnimationList();
+                                       Assign_color_animations( listid, AnimCurves , "diffuse_color" );
+                               }
                        }
                }       
        }
@@ -1002,6 +1008,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
                        COLLADAFW::EffectCommon *efc = commonEffects[0];
                        types->material =  setAnimType(&(efc->getShininess()),(types->material), MATERIAL_SHININESS);
                        types->material =  setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
+                       types->material =  setAnimType(&(efc->getDiffuse().getColor()),(types->material), MATERIAL_DIFF_COLOR);
                
                }
        }
index a274d0e..642d218 100644 (file)
@@ -109,7 +109,8 @@ private:
        enum matAnim
        {
                MATERIAL_SHININESS = 2,
-               MATERIAL_SPEC_COLOR = 4
+               MATERIAL_SPEC_COLOR = 4,
+               MATERIAL_DIFF_COLOR = 1 << 3
        };
        
        enum AnimationType