diff --git a/KREngine/kraken/KRAnimationCurveManager.cpp b/KREngine/kraken/KRAnimationCurveManager.cpp index 548d378..08c6cbe 100644 --- a/KREngine/kraken/KRAnimationCurveManager.cpp +++ b/KREngine/kraken/KRAnimationCurveManager.cpp @@ -50,12 +50,19 @@ void KRAnimationCurveManager::deleteAnimationCurve(KRAnimationCurve *curve) { KRAnimationCurve *KRAnimationCurveManager::loadAnimationCurve(const std::string &name, KRDataBlock *data) { KRAnimationCurve *pAnimationCurve = KRAnimationCurve::Load(*m_pContext, name, data); - m_animationCurves[name] = pAnimationCurve; + if(pAnimationCurve) { + m_animationCurves[name] = pAnimationCurve; + } return pAnimationCurve; } KRAnimationCurve *KRAnimationCurveManager::getAnimationCurve(const std::string &name) { - return m_animationCurves[name]; + unordered_map::iterator itr = m_animationCurves.find(name); + if(itr == m_animationCurves.end()) { + return NULL; // Not found + } else { + return (*itr).second; + } } unordered_map &KRAnimationCurveManager::getAnimationCurves() { @@ -64,6 +71,7 @@ unordered_map &KRAnimationCurveManager::getAnim void KRAnimationCurveManager::addAnimationCurve(KRAnimationCurve *new_animation_curve) { + assert(new_animation_curve != NULL); m_animationCurves[new_animation_curve->getName()] = new_animation_curve; } diff --git a/KREngine/kraken/KRResource+fbx.cpp b/KREngine/kraken/KRResource+fbx.cpp index bb82a8f..e778d03 100644 --- a/KREngine/kraken/KRResource+fbx.cpp +++ b/KREngine/kraken/KRResource+fbx.cpp @@ -1420,8 +1420,9 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe FbxVector2 uv; bool unmapped = false; if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) { - assert(!unmapped); - new_uva = KRVector2(uv[0], uv[1]); + if(!unmapped) { + new_uva = KRVector2(uv[0], uv[1]); + } } mi.uva.push_back(new_uva); } @@ -1431,8 +1432,9 @@ void LoadMesh(KRContext &context, FbxScene* pFbxScene, FbxGeometryConverter *pGe FbxVector2 uv; bool unmapped = false; if(pMesh->GetPolygonVertexUV(iPolygon, iVertex, setName, uv, unmapped)) { - assert(!unmapped); - new_uvb = KRVector2(uv[0], uv[1]); + if(!unmapped) { + new_uvb = KRVector2(uv[0], uv[1]); + } } mi.uvb.push_back(new_uvb); }