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

Function ExportModel

tools/assimp_cmd/Main.cpp:334–381  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

332#ifndef ASSIMP_BUILD_NO_EXPORT
333// ------------------------------------------------------------------------------
334bool ExportModel(const aiScene* pOut,
335 const ImportData& imp,
336 const std::string& path,
337 const char* pID)
338{
339 // Attach log streams
340 if (imp.log) {
341 SetLogStreams(imp);
342 }
343 printf("Launching asset export ... OK\n");
344
345 if (imp.showLog) {
346 PrintHorBar();
347 }
348
349 aiMatrix4x4 rx, ry, rz;
350 aiMatrix4x4::RotationX(imp.rot.x, rx);
351 aiMatrix4x4::RotationY(imp.rot.y, ry);
352 aiMatrix4x4::RotationZ(imp.rot.z, rz);
353 pOut->mRootNode->mTransformation *= rx;
354 pOut->mRootNode->mTransformation *= ry;
355 pOut->mRootNode->mTransformation *= rz;
356
357 // do the actual export, measure time
358 const clock_t first = clock();
359 const aiReturn res = globalExporter->Export(pOut,pID,path);
360
361 if (imp.showLog) {
362 PrintHorBar();
363 }
364 if (res != AI_SUCCESS) {
365 printf("Failed to write file\n");
366 printf("ERROR: %s\n", globalExporter->GetErrorString());
367 return false;
368 }
369
370 const clock_t second = ::clock();
371 const double seconds = static_cast<double>(second-first) / CLOCKS_PER_SEC;
372
373 printf("Exporting file ... OK \n export took approx. %.5f seconds\n"
374 "\n",seconds);
375
376 if (imp.log) {
377 FreeLogStreams();
378 }
379
380 return true;
381}
382#endif
383
384// ------------------------------------------------------------------------------

Callers 1

Assimp_ExportFunction · 0.85

Calls 5

SetLogStreamsFunction · 0.85
PrintHorBarFunction · 0.85
FreeLogStreamsFunction · 0.85
ExportMethod · 0.45
GetErrorStringMethod · 0.45

Tested by

no test coverage detected