diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-24 00:49:26 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-24 00:49:26 +0400 |
commit | c22f26d2032b7116477e6a378407a10b6d7e3276 (patch) | |
tree | d16d29d4cd89e4915a8ffc782d8c6d0513f64e07 /source/blender/collada/DocumentImporter.cpp | |
parent | 682cc631613dd8dcdcfec30246e191cec93f4006 (diff) |
Material Hardness Animation Import Complete.
Diffstat (limited to 'source/blender/collada/DocumentImporter.cpp')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 2ff791eb91d..d4eeb594922 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -537,7 +537,10 @@ 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; + this->matUidforEffect = &(cmat->getUniqueId()); + /*COLLADAFW::Material * matCopy = new COLLADAFW::Material(&cmat); + this->FW_object_map[cmat->getUniqueId()] = matCopy; + *///matForEff = cmat; return true; } @@ -722,13 +725,21 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) return true; const COLLADAFW::UniqueId& uid = effect->getUniqueId(); + if (uid_effect_map.find(uid) == uid_effect_map.end()) { fprintf(stderr, "Couldn't find a material by UID.\n"); return true; } Material *ma = uid_effect_map[uid]; - + std::map<COLLADAFW::UniqueId, Material*>::iterator iter; + for(iter = uid_material_map.begin(); iter != uid_material_map.end() ; iter++ ) + { + if ( iter->second == ma ) { + this->FW_object_map[iter->first] = effect; + break; + } + } COLLADAFW::CommonEffectPointerArray common_efs = effect->getCommonEffects(); if (common_efs.getCount() < 1) { fprintf(stderr, "Couldn't find <profile_COMMON>.\n"); @@ -739,6 +750,7 @@ bool DocumentImporter::writeEffect( const COLLADAFW::Effect* effect ) COLLADAFW::EffectCommon *ef = common_efs[0]; write_profile_COMMON(ef, ma); this->FW_object_map[effect->getUniqueId()] = effect; + return true; } |