diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-18 23:32:51 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-18 23:32:51 +0400 |
commit | 2fb7dbd60c4d031e9a79ef7e8f731e7615443b32 (patch) | |
tree | 2423d049b6f1d5c0f519677bebbdd7e3b3ad7d95 | |
parent | 0dcc7d05abe9d1557675c63e07f8b5ff3cb49ec3 (diff) |
Material Specular Hardness Animation import (ongoing)
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 14 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.h | 3 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 3faad447e9a..129f3192ce2 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -966,6 +966,20 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD 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; } diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h index c11ded7fb3a..b27fba18954 100644 --- a/source/blender/collada/AnimationImporter.h +++ b/source/blender/collada/AnimationImporter.h @@ -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" diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index a5946b4aa88..2ff791eb91d 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -537,7 +537,7 @@ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat ) 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 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) // 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; } |