| 432 | } |
| 433 | |
| 434 | void performMeshSkinning(const std::string &id, const int objId) |
| 435 | { |
| 436 | const std::string outputPath = FileSystem::normalizePath(exePath + "/output/" + FileSystem::getFileName(sceneFile)); |
| 437 | if (partioPath == "") |
| 438 | partioPath = FileSystem::normalizePath(outputPath + "/partio"); |
| 439 | |
| 440 | std::string fileName; |
| 441 | if (useSplitting) |
| 442 | { |
| 443 | fileName = FileSystem::normalizePath(partioPath + "/ParticleData_" + id + "_" + std::to_string(objId) + "_" + std::to_string(startFrame) + ".bgeo"); |
| 444 | input = FileSystem::normalizePath(partioPath + "/ParticleData_" + id + "_" + std::to_string(objId) + "_#.bgeo"); |
| 445 | output = FileSystem::normalizePath(partioPath + "/../meshes/ParticleData_" + id + "_" + std::to_string(objId) + "_#.ply"); |
| 446 | } |
| 447 | else |
| 448 | { |
| 449 | fileName = FileSystem::normalizePath(partioPath + "/ParticleData_" + id + "_" + std::to_string(startFrame) + ".bgeo"); |
| 450 | input = FileSystem::normalizePath(partioPath + "/ParticleData_" + id + "_#.bgeo"); |
| 451 | output = FileSystem::normalizePath(partioPath + "/../meshes/ParticleData_" + id + "_#.ply"); |
| 452 | } |
| 453 | |
| 454 | if (FileSystem::fileExists(fileName)) |
| 455 | { |
| 456 | output_format = 2; |
| 457 | |
| 458 | if (!FileSystem::fileExists(meshFile)) |
| 459 | { |
| 460 | LOG_ERR << "Visualization mesh file defined in scene file is missing: " << meshFile; |
| 461 | return; |
| 462 | } |
| 463 | |
| 464 | LOG_INFO << "Input: " << input; |
| 465 | LOG_INFO << "Output: " << output; |
| 466 | LOG_INFO << "Mesh file: " << meshFile; |
| 467 | LOG_INFO << "Particle radius: " << radius; |
| 468 | LOG_INFO << "Scale: " << scale; |
| 469 | LOG_INFO << "Translation: " << translation; |
| 470 | |
| 471 | MeshImport::importMesh(meshFile, mesh, translation, rotation, scale); |
| 472 | |
| 473 | // read reference configuration |
| 474 | readFrame(x0, 1); |
| 475 | LOG_INFO << "# particles: " << x0.size(); |
| 476 | |
| 477 | init(); |
| 478 | |
| 479 | meshSkinning(); |
| 480 | } |
| 481 | else |
| 482 | { |
| 483 | LOG_ERR << "Input file not found: " << fileName; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | void performMeshSkinning() |
| 488 | { |
no test coverage detected