MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getModelNodeForStaticResource

Method getModelNodeForStaticResource

radiantcore/model/ModelCache.cpp:72–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72scene::INodePtr ModelCache::getModelNodeForStaticResource(const std::string& resourcePath)
73{
74 // Get the extension of this model
75 auto extension = os::getExtension(resourcePath);
76
77 // Find a suitable model loader
78 auto modelLoader = GlobalModelFormatManager().getImporter(extension);
79
80 auto fullPath = module::GlobalModuleRegistry().getApplicationContext().getRuntimeDataPath();
81 fullPath += "resources/" + resourcePath;
82
83 auto node = modelLoader->loadModel(fullPath);
84
85 return node ? node : loadNullModel(resourcePath);
86}
87
88scene::INodePtr ModelCache::loadNullModel(const std::string& modelPath)
89{

Callers 2

setupRoomMethod · 0.80
setupTestModelMethod · 0.80

Calls 4

getExtensionFunction · 0.85
getImporterMethod · 0.80
getRuntimeDataPathMethod · 0.45
loadModelMethod · 0.45

Tested by

no test coverage detected