feat: expand editor scripting asset and viewport flow
This commit is contained in:
@@ -592,6 +592,28 @@ bool AssetDatabase::TryGetPrimaryAssetPath(const AssetGUID& guid, Containers::St
|
||||
return true;
|
||||
}
|
||||
|
||||
void AssetDatabase::BuildLookupSnapshot(std::unordered_map<std::string, AssetGUID>& outPathToGuid,
|
||||
std::unordered_map<AssetGUID, Containers::String>& outGuidToPath) const {
|
||||
outPathToGuid.clear();
|
||||
outGuidToPath.clear();
|
||||
outPathToGuid.reserve(m_sourcesByPathKey.size());
|
||||
outGuidToPath.reserve(m_sourcesByGuid.size());
|
||||
|
||||
for (const auto& [pathKey, record] : m_sourcesByPathKey) {
|
||||
if (!record.guid.IsValid() || record.relativePath.Empty()) {
|
||||
continue;
|
||||
}
|
||||
outPathToGuid[pathKey] = record.guid;
|
||||
}
|
||||
|
||||
for (const auto& [guid, record] : m_sourcesByGuid) {
|
||||
if (!guid.IsValid() || record.relativePath.Empty()) {
|
||||
continue;
|
||||
}
|
||||
outGuidToPath[guid] = record.relativePath;
|
||||
}
|
||||
}
|
||||
|
||||
void AssetDatabase::EnsureProjectLayout() {
|
||||
std::error_code ec;
|
||||
fs::create_directories(fs::path(m_assetsRoot.CStr()), ec);
|
||||
|
||||
Reference in New Issue
Block a user