MCPcopy Create free account
hub / github.com/assimp/assimp / ExportToBlob

Method ExportToBlob

code/Common/Exporter.cpp:337–360  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

335
336// ------------------------------------------------------------------------------------------------
337const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId,
338 unsigned int pPreprocessing, const ExportProperties* pProperties) {
339 ai_assert(nullptr != pimpl);
340 if (pimpl->blob) {
341 delete pimpl->blob;
342 pimpl->blob = nullptr;
343 }
344
345 auto baseName = pProperties ? pProperties->GetPropertyString(AI_CONFIG_EXPORT_BLOB_NAME, AI_BLOBIO_MAGIC) : AI_BLOBIO_MAGIC;
346
347 std::shared_ptr<IOSystem> old = pimpl->mIOSystem;
348 BlobIOSystem *blobio = new BlobIOSystem(baseName);
349 pimpl->mIOSystem = std::shared_ptr<IOSystem>( blobio );
350
351 if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName(), pPreprocessing, pProperties)) {
352 pimpl->mIOSystem = old;
353 return nullptr;
354 }
355
356 pimpl->blob = blobio->GetBlobChain();
357 pimpl->mIOSystem = old;
358
359 return pimpl->blob;
360}
361
362// ------------------------------------------------------------------------------------------------
363aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath,

Callers 4

TEST_FFunction · 0.45
TEST_FFunction · 0.45
LLVMFuzzerTestOneInputFunction · 0.45
aiExportSceneToBlobFunction · 0.45

Calls 3

GetMagicFileNameMethod · 0.80
GetBlobChainMethod · 0.80
GetPropertyStringMethod · 0.45

Tested by

no test coverage detected