Skip to content

Commit

Permalink
Merge pull request #2519 from RichardTea/issue_2518_active_importer_i…
Browse files Browse the repository at this point in the history
…dent

API: Add active importer identification
  • Loading branch information
kimkulling committed Jun 28, 2019
2 parents 07779a7 + 05f5b54 commit 1ec01a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/Common/Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,12 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)

// Find an worker class which can handle the file
BaseImporter* imp = NULL;
SetPropertyInteger("importerIndex", -1);
for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {

if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, false)) {
imp = pimpl->mImporter[a];
SetPropertyInteger("importerIndex", a);
break;
}
}
Expand All @@ -606,6 +608,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {
if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) {
imp = pimpl->mImporter[a];
SetPropertyInteger("importerIndex", a);
break;
}
}
Expand Down

0 comments on commit 1ec01a8

Please sign in to comment.