5 std::set<std::string> allPaths;
7 std::string absoluteModelPath;
9 if (std::filesystem::exists(modelPath)) {
10 absoluteModelPath = std::filesystem::canonical(modelPath).string();
12 absoluteModelPath = std::filesystem::absolute(modelPath).string();
14 allPaths.insert(absoluteModelPath);
15 }
catch (
const std::filesystem::filesystem_error&) {
16 allPaths.insert(modelPath);
17 absoluteModelPath = modelPath;
20 std::filesystem::path modelFilePath(absoluteModelPath);
21 std::string extension = modelFilePath.extension().string();
23 std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
26 allPaths.insert(texturePaths.begin(), texturePaths.end());
30 std::filesystem::path modelDir = std::filesystem::path(absoluteModelPath).parent_path();
31 for (
const auto& relativePath : specificDependencies) {
33 std::string absolutePath = std::filesystem::canonical(modelDir / relativePath).string();
34 allPaths.insert(absolutePath);
35 }
catch (
const std::filesystem::filesystem_error&) {
36 std::string absolutePath = std::filesystem::absolute(modelDir / relativePath).string();
37 allPaths.insert(absolutePath);
46 std::set<std::string> dependencies;
48 std::filesystem::path modelFilePath(modelPath);
49 std::string extension = modelFilePath.extension().string();
50 std::string baseName = modelFilePath.stem().string();
52 std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
53 if (extension ==
".obj") {
54 dependencies.insert(baseName +
".mtl");
56 else if (extension ==
".gltf")
58 dependencies.insert(baseName +
".bin");
60 else if (extension ==
".fbx")
63 }
else if (extension ==
".glb")
66 }
else if (extension ==
".usdz")