| 294 | } |
| 295 | |
| 296 | void SceneBuilder::importFromMemory(const void* buffer, size_t byteSize, std::string_view extension, const pybind11::dict& dict) |
| 297 | { |
| 298 | logInfo("Importing scene from memory"); |
| 299 | std::map<std::string, std::string> materialToShortName = convertDictToMap(dict); |
| 300 | |
| 301 | mSceneData.importPaths.push_back("<memory>"); |
| 302 | mSceneData.importDicts.push_back(materialToShortName); |
| 303 | |
| 304 | if (auto importer = Importer::create(extension)) |
| 305 | { |
| 306 | importer->importSceneFromMemory(buffer, byteSize, extension, *this, materialToShortName); |
| 307 | } |
| 308 | else |
| 309 | { |
| 310 | throw ImporterError("", "Unknown file extension."); |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | void SceneBuilder::pushAssetResolver() |
| 315 | { |
nothing calls this directly
no test coverage detected