| 270 | } |
| 271 | |
| 272 | void SceneBuilder::import(const std::filesystem::path& path, const pybind11::dict& dict) |
| 273 | { |
| 274 | logInfo("Importing scene: {}", path); |
| 275 | std::map<std::string, std::string> materialToShortName = convertDictToMap(dict); |
| 276 | |
| 277 | std::filesystem::path resolvedPath = mAssetResolver.resolvePath(path, AssetCategory::Scene); |
| 278 | if (resolvedPath.empty()) |
| 279 | { |
| 280 | throw ImporterError(path, "Can't find scene file '{}'.", path); |
| 281 | } |
| 282 | |
| 283 | mSceneData.importPaths.push_back(resolvedPath); |
| 284 | mSceneData.importDicts.push_back(materialToShortName); |
| 285 | |
| 286 | if (auto importer = Importer::create(getExtensionFromPath(resolvedPath))) |
| 287 | { |
| 288 | importer->importScene(resolvedPath, *this, materialToShortName); |
| 289 | } |
| 290 | else |
| 291 | { |
| 292 | throw ImporterError(resolvedPath, "Unknown file extension."); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | void SceneBuilder::importFromMemory(const void* buffer, size_t byteSize, std::string_view extension, const pybind11::dict& dict) |
| 297 | { |
nothing calls this directly
no test coverage detected