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

Method resolvePath

Source/Falcor/Core/AssetResolver.cpp:40–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40std::filesystem::path AssetResolver::resolvePath(const std::filesystem::path& path, AssetCategory category) const
41{
42 FALCOR_CHECK(category < AssetCategory::Count, "Invalid asset category.");
43
44 // If this is an existing absolute path, or a relative path to the working directory, return it.
45 std::filesystem::path absolute = std::filesystem::absolute(path);
46 if (std::filesystem::exists(absolute))
47 return std::filesystem::canonical(absolute);
48
49 // Otherwise, try to resolve using search paths.
50 // First try resolving for the specified asset category.
51 std::filesystem::path resolved = mSearchContexts[size_t(category)].resolvePath(path);
52
53 // If not resolved, try resolving for the Any asset category.
54 if (category != AssetCategory::Any && resolved.empty())
55 resolved = mSearchContexts[size_t(AssetCategory::Any)].resolvePath(path);
56
57 if (resolved.empty())
58 logWarning("Failed to resolve path '{}' for asset type '{}'.", path, category);
59
60 return resolved;
61}
62
63std::vector<std::filesystem::path> AssetResolver::resolvePathPattern(
64 const std::filesystem::path& path,

Callers 15

loadReferenceMethod · 0.45
loadImageMethod · 0.45
loadTextureMethod · 0.45
SceneBuilderMethod · 0.45
importMethod · 0.45
loadMaterialTextureMethod · 0.45
loadLightProfileMethod · 0.45
FALCOR_SCRIPT_BINDINGFunction · 0.45
FALCOR_SCRIPT_BINDINGFunction · 0.45
FALCOR_SCRIPT_BINDINGFunction · 0.45
FALCOR_SCRIPT_BINDINGFunction · 0.45
FALCOR_SCRIPT_BINDINGFunction · 0.45

Calls 2

logWarningFunction · 0.50
emptyMethod · 0.45

Tested by 1

CPU_TESTFunction · 0.36