OpenGEX: improve logging to be able to detect error-prone situations.

pull/1468/head
Kim Kulling 2017-10-02 09:41:01 +02:00
parent 3f4663e369
commit 6ec25be0a6
1 changed files with 10 additions and 2 deletions

View File

@ -1182,8 +1182,16 @@ void OpenGEXImporter::resolveReferences() {
const std::string name( currentRefInfo->m_Names[ i ] ); const std::string name( currentRefInfo->m_Names[ i ] );
ReferenceMap::const_iterator it( m_material2refMap.find( name ) ); ReferenceMap::const_iterator it( m_material2refMap.find( name ) );
if ( m_material2refMap.end() != it ) { if ( m_material2refMap.end() != it ) {
unsigned int matIdx = static_cast< unsigned int >( m_material2refMap[ name ] ); if ( nullptr != m_currentMesh ) {
m_currentMesh->mMaterialIndex = matIdx; unsigned int matIdx = static_cast< unsigned int >( m_material2refMap[ name ] );
if ( m_currentMesh->mMaterialIndex != 0 ) {
DefaultLogger::get()->warn( "Override of material reference in current mesh by material reference." );
}
m_currentMesh->mMaterialIndex = matIdx;
} else {
DefaultLogger::get()->warn( "Cannot resolve material reference, because no current mesh is there." );
}
} }
} }
} else { } else {