MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / loadSceneFromAnySupportedFormat

Function loadSceneFromAnySupportedFormat

source/MRMesh/MRObjectLoad.cpp:531–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531Expected<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
551Expected<LoadedObject> deserializeObjectTree( const std::filesystem::path& path, const FolderCallback& postDecompress,
552 const ProgressCallback& progressCb )

Callers 2

TESTFunction · 0.85
loadObjectFromFileFunction · 0.85

Calls 3

utf8stringFunction · 0.85
postImportObjectFunction · 0.85

Tested by 1

TESTFunction · 0.68