| 318 | |
| 319 | #if defined(BUILD_MATERIAL_EXTERNAL) |
| 320 | void ModelManager::migrateToExternal(const std::shared_ptr<Materials::ModelLibrary>& library) |
| 321 | { |
| 322 | try { |
| 323 | _externalManager->createLibrary(library->getName(), |
| 324 | library->getIcon(), |
| 325 | library->isReadOnly()); |
| 326 | } |
| 327 | catch (const CreationError&) { |
| 328 | } |
| 329 | catch (const ConnectionError&) { |
| 330 | } |
| 331 | |
| 332 | auto models = _localManager->libraryModels(library->getName()); |
| 333 | for (auto& it : *models) { |
| 334 | auto uuid = it.getUUID(); |
| 335 | auto path = it.getPath(); |
| 336 | auto name = it.getName(); |
| 337 | Base::Console().log("\t('%s', '%s', '%s')\n", |
| 338 | uuid.toStdString().c_str(), |
| 339 | path.toStdString().c_str(), |
| 340 | name.toStdString().c_str()); |
| 341 | |
| 342 | auto model = _localManager->getModel(uuid); |
| 343 | _externalManager->migrateModel(library->getName(), path, *model); |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | void ModelManager::validateMigration(const std::shared_ptr<Materials::ModelLibrary>& library) |
| 348 | { |
no test coverage detected