Revision: 38490
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38490
Author:   phabtar
Date:     2011-07-18 19:32:51 +0000 (Mon, 18 Jul 2011)
Log Message:
-----------
Material Specular Hardness Animation import (ongoing)

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
    branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
    branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp       
2011-07-18 19:06:18 UTC (rev 38489)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.cpp       
2011-07-18 19:32:51 UTC (rev 38490)
@@ -966,6 +966,20 @@
                if ( types->camera != 0) break;
 
        }
+
+       const COLLADAFW::InstanceGeometryPointerArray& nodeGeoms = 
node->getInstanceGeometries();
+       for (unsigned int i = 0; i < nodeGeoms.getCount(); i++) {
+               const COLLADAFW::MaterialBindingArray& matBinds = 
nodeGeoms[i]->getMaterialBindings();
+               for (unsigned int j = 0; i < matBinds.getCount(); i++) {
+                       const COLLADAFW::Material *mat = (COLLADAFW::Material 
*) FW_object_map[matBinds[i].getReferencedMaterial()];
+                       const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) 
FW_object_map[mat->getInstantiatedEffect()];
+                       const COLLADAFW::CommonEffectPointerArray& 
commonEffects  =  ef->getCommonEffects();
+                       for (unsigned int k = 0; i < commonEffects.getCount(); 
i++) {
+                               types->material =  
setAnimType(&(commonEffects[i]->getShininess()),(types->material), 
MATERIAL_SHININESS);
+                       }
+               }
+               
+       }
        return types;
 }
 

Modified: branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 
2011-07-18 19:06:18 UTC (rev 38489)
+++ branches/soc-2011-pepper/source/blender/collada/AnimationImporter.h 
2011-07-18 19:32:51 UTC (rev 38490)
@@ -39,6 +39,9 @@
 #include "COLLADAFWUniqueId.h"
 #include "COLLADAFWLight.h"
 #include "COLLADAFWCamera.h"
+#include "COLLADAFWMaterial.h"
+#include "COLLADAFWEffect.h"
+#include "COLLADAFWInstanceGeometry.h"
 
 #include "DNA_anim_types.h"
 #include "DNA_object_types.h"

Modified: branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp        
2011-07-18 19:06:18 UTC (rev 38489)
+++ branches/soc-2011-pepper/source/blender/collada/DocumentImporter.cpp        
2011-07-18 19:32:51 UTC (rev 38490)
@@ -537,7 +537,7 @@
        
        this->uid_effect_map[cmat->getInstantiatedEffect()] = ma;
        this->uid_material_map[cmat->getUniqueId()] = ma;
-       
+       this->FW_object_map[cmat->getUniqueId()] = cmat;
        return true;
 }
 
@@ -738,7 +738,7 @@
        // Currently only first <profile_common> is supported
        COLLADAFW::EffectCommon *ef = common_efs[0];
        write_profile_COMMON(ef, ma);
-       
+       this->FW_object_map[effect->getUniqueId()] = effect;
        return true;
 }
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to