MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / import

Method import

Source/Falcor/Scene/SceneBuilder.cpp:272–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 9

logInfoFunction · 0.85
convertDictToMapFunction · 0.85
ImporterErrorFunction · 0.85
getExtensionFromPathFunction · 0.85
createFunction · 0.50
resolvePathMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
importSceneMethod · 0.45

Tested by

no test coverage detected