[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38766] branches/soc-2011-pepper/source/ blender/collada: Material Diffuse Color animation COLLADA import.
Sukhitha Jayathilake
pr.jayathilake at gmail.com
Wed Jul 27 21:08:18 CEST 2011
Revision: 38766
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38766
Author: phabtar
Date: 2011-07-27 19:08:18 +0000 (Wed, 27 Jul 2011)
Log Message:
-----------
Material Diffuse Color animation COLLADA import.
Modified Paths:
--------------
branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-27 18:57:57 UTC (rev 38765)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationExporter.cpp 2011-07-27 19:08:18 UTC (rev 38766)
@@ -112,7 +112,7 @@
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;
}
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp 2011-07-27 18:57:57 UTC (rev 38765)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp 2011-07-27 19:08:18 UTC (rev 38766)
@@ -934,6 +934,12 @@
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 @@
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);
}
}
Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 2011-07-27 18:57:57 UTC (rev 38765)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 2011-07-27 19:08:18 UTC (rev 38766)
@@ -109,7 +109,8 @@
enum matAnim
{
MATERIAL_SHININESS = 2,
- MATERIAL_SPEC_COLOR = 4
+ MATERIAL_SPEC_COLOR = 4,
+ MATERIAL_DIFF_COLOR = 1 << 3
};
enum AnimationType
More information about the Bf-blender-cvs
mailing list