Animation clips now load the correct raw animation

This commit is contained in:
Kah Wei 2023-03-09 14:47:48 +08:00
parent ac971f0945
commit ab2f3e395b
2 changed files with 2 additions and 1 deletions

View File

@ -87,6 +87,7 @@ namespace SHADE
animClip->name = newAssetName; animClip->name = newAssetName;
animClip->firstIndex = firstIndex; animClip->firstIndex = firstIndex;
animClip->lastIndex = lastIndex; animClip->lastIndex = lastIndex;
animClip->animRawDataAssetId = SHResourceManager::GetAssetID<SHRawAnimation>(rawAnimation).value_or(0);
SHAssetManager::SaveAsset(containerAsset->id); SHAssetManager::SaveAsset(containerAsset->id);
// Close // Close

View File

@ -370,7 +370,7 @@ namespace SHADE
loadedAssetData.emplace_back(assetId); loadedAssetData.emplace_back(assetId);
return resourceHub.Create<ResourceType> return resourceHub.Create<ResourceType>
( (
LoadOrGet<SHRawAnimation>(assetId), // TODO: Wrong, we need to grab the parent asset's ID LoadOrGet<SHRawAnimation>(assetData.animRawDataAssetId),
assetData.firstIndex, assetData.firstIndex,
assetData.lastIndex assetData.lastIndex
); );