diff --git a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetDirectoryProcessor.cpp b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetDirectoryProcessor.cpp index 08ed73adc..00c2ceee6 100644 --- a/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetDirectoryProcessor.cpp +++ b/Volt/Sandbox/src/Sandbox/Window/AssetBrowser/AssetDirectoryProcessor.cpp @@ -55,9 +55,10 @@ Ref AssetDirectoryProcessor::ProcessDirectories(con { auto relPath = Volt::AssetManager::GetRelativePath(entry.path); Ref dirData = CreateRef(m_selectionManager.Get(), relPath); - directoryItems[relPath] = dirData; - directoryItems[relPath.parent_path()]->subDirectories.emplace_back(dirData); - dirData->parentDirectory = directoryItems[relPath.parent_path()].get(); + directoryItems[relPath] = dirData; + const auto parentPath = Volt::AssetManager::GetRelativePath(entry.path.parent_path()); + directoryItems[parentPath]->subDirectories.emplace_back(dirData); + dirData->parentDirectory = directoryItems[parentPath].get(); } else { @@ -74,8 +75,9 @@ Ref AssetDirectoryProcessor::ProcessDirectories(con if (m_assetMask == Volt::AssetType::None || (m_assetMask & type) != Volt::AssetType::None) { auto relPath = Volt::AssetManager::GetRelativePath(entry.path); - Ref assetItem = CreateRef(m_selectionManager.Get(), relPath, meshImportData, meshToImportData); - directoryItems[relPath.parent_path()]->assets.emplace_back(assetItem); + Ref assetItem = CreateRef(m_selectionManager.Get(), relPath, meshImportData, meshToImportData); + const auto parentPath = Volt::AssetManager::GetRelativePath(entry.path.parent_path()); + directoryItems[parentPath]->assets.emplace_back(assetItem); } } }