------------------------------------------------------------------------------
| 332 | #ifndef ASSIMP_BUILD_NO_EXPORT |
| 333 | // ------------------------------------------------------------------------------ |
| 334 | bool 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 | // ------------------------------------------------------------------------------ |
no test coverage detected