| 331 | } |
| 332 | |
| 333 | std::shared_ptr<Material> |
| 334 | MaterialLibraryLocal::addMaterial(const std::shared_ptr<Material>& material, const QString& path) |
| 335 | { |
| 336 | QString filePath = getRelativePath(path); |
| 337 | QFileInfo info(filePath); |
| 338 | std::shared_ptr<Material> newMaterial = std::make_shared<Material>(*material); |
| 339 | newMaterial->setLibrary(getptr()); |
| 340 | newMaterial->setDirectory(getLibraryPath(filePath, info.fileName())); |
| 341 | newMaterial->setFilename(info.fileName()); |
| 342 | |
| 343 | (*_materialPathMap)[filePath] = newMaterial; |
| 344 | |
| 345 | return newMaterial; |
| 346 | } |
| 347 | |
| 348 | std::shared_ptr<Material> MaterialLibraryLocal::getMaterialByPath(const QString& path) const |
| 349 | { |
nothing calls this directly
no test coverage detected