Add content deprecation system that auto-saves assets in Editor that use old data format

This commit is contained in:
Wojtek Figat
2025-01-20 23:46:49 +01:00
parent 1497acef58
commit 8a7ceef288
67 changed files with 751 additions and 427 deletions

View File

@@ -226,16 +226,8 @@ void Animation::LoadTimeline(BytesContainer& result) const
bool Animation::SaveTimeline(BytesContainer& data)
{
// Wait for asset to be loaded or don't if last load failed (eg. by shader source compilation error)
if (LastLoadFailed())
{
LOG(Warning, "Saving asset that failed to load.");
}
else if (WaitForLoaded())
{
LOG(Error, "Asset loading failed. Cannot save it.");
if (OnCheckSave())
return true;
}
ScopeLock lock(Locker);
MemoryReadStream stream(data.Get(), data.Length());
@@ -401,17 +393,8 @@ bool Animation::SaveTimeline(BytesContainer& data)
bool Animation::Save(const StringView& path)
{
// Wait for asset to be loaded or don't if last load failed (eg. by shader source compilation error)
if (LastLoadFailed())
{
LOG(Warning, "Saving asset that failed to load.");
}
else if (WaitForLoaded())
{
LOG(Error, "Asset loading failed. Cannot save it.");
if (OnCheckSave(path))
return true;
}
ScopeLock lock(Locker);
// Serialize animation data to the stream