Skip to content

Commit 060a130

Browse files
committed
fix(editor): resolve embedded material asset references
1 parent a2bb45b commit 060a130

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Sources/OvEditor/src/OvEditor/Core/Editor.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,22 @@ void OvEditor::Core::Editor::SetupUI()
147147
OvCore::Helpers::GUIHelpers::SetAssetExistsChecker(
148148
[this](const std::string& p_path)
149149
{
150-
return std::filesystem::exists(m_editorActions.GetRealPath(p_path));
150+
const std::string path = OvTools::Utils::PathParser::MakeNonWindowsStyle(p_path);
151+
152+
if (const auto embeddedAssetPath = ParseEmbeddedAssetPath(path); embeddedAssetPath)
153+
{
154+
const bool isEmbeddedMaterial = ParseEmbeddedMaterialIndex(embeddedAssetPath->assetName).has_value();
155+
const bool isEmbeddedTexture = ParseEmbeddedTextureIndex(embeddedAssetPath->assetName).has_value();
156+
157+
if (isEmbeddedMaterial || isEmbeddedTexture)
158+
{
159+
return std::filesystem::exists(m_editorActions.GetRealPath(embeddedAssetPath->modelPath));
160+
}
161+
162+
return false;
163+
}
164+
165+
return std::filesystem::exists(m_editorActions.GetRealPath(path));
151166
}
152167
);
153168

0 commit comments

Comments
 (0)