| 529 | } |
| 530 | |
| 531 | Expected<LoadedObject> loadSceneFromAnySupportedFormat( const std::filesystem::path& path, const ProgressCallback& callback ) |
| 532 | { |
| 533 | auto ext = std::string( "*" ) + utf8string( path.extension().u8string() ); |
| 534 | for ( auto& c : ext ) |
| 535 | c = ( char )tolower( c ); |
| 536 | |
| 537 | auto loader = SceneLoad::getSceneLoader( ext ); |
| 538 | if ( !loader ) |
| 539 | return unexpectedUnsupportedFileExtension(); |
| 540 | |
| 541 | return loader( path, callback ) |
| 542 | .and_then( [&] ( LoadedObject&& l ) -> Expected<LoadedObject> |
| 543 | { |
| 544 | if ( ext != "*.mru" && ext != "*.zip" ) |
| 545 | postImportObject( l.obj, path ); |
| 546 | |
| 547 | return std::move( l ); |
| 548 | } ); |
| 549 | } |
| 550 | |
| 551 | Expected<LoadedObject> deserializeObjectTree( const std::filesystem::path& path, const FolderCallback& postDecompress, |
| 552 | const ProgressCallback& progressCb ) |