Added serialisation of extra time multiplier field in animation clip asset

Fixed bug when creating animation clip
This commit is contained in:
XiaoQiDigipen 2023-03-14 16:47:08 +08:00
parent d8fe6a2f11
commit 3ca463aa21
6 changed files with 6 additions and 6 deletions

View File

@ -180,8 +180,8 @@ namespace Sandbox
// Link up SHDebugDraw // Link up SHDebugDraw
SHDebugDraw::Init(SHSystemManager::GetSystem<SHDebugDrawSystem>()); SHDebugDraw::Init(SHSystemManager::GetSystem<SHDebugDrawSystem>());
auto clip = SHResourceManager::LoadOrGet<SHRawAnimation>(77816045); //auto clip = SHResourceManager::LoadOrGet<SHRawAnimation>(77816045);
auto rig = SHResourceManager::LoadOrGet<SHRig>(77816045); //auto rig = SHResourceManager::LoadOrGet<SHRig>(77816045);
} }
void SBApplication::Update(void) void SBApplication::Update(void)

View File

@ -25,8 +25,8 @@ namespace SHADE
std::string name; std::string name;
uint32_t firstIndex; uint32_t firstIndex;
uint32_t lastIndex; uint32_t lastIndex;
AssetID animRawDataAssetId; // Not serialised, only populated during runtime from parent asset
float playbackMultiplier = 1.0f; float playbackMultiplier = 1.0f;
AssetID animRawDataAssetId; // Not serialised, only populated during runtime from parent asset
}; };
struct SH_API SHAnimClipContainerAsset final : SHAssetData struct SH_API SHAnimClipContainerAsset final : SHAssetData

View File

@ -79,7 +79,7 @@ namespace SHADE
file.write( file.write(
reinterpret_cast<char const*>(&clip->firstIndex), reinterpret_cast<char const*>(&clip->firstIndex),
sizeof(uint32_t) * 2 sizeof(uint32_t) * 3
); );
} }
} }
@ -118,7 +118,7 @@ namespace SHADE
file.read( file.read(
reinterpret_cast<char*>(&clip->firstIndex), reinterpret_cast<char*>(&clip->firstIndex),
sizeof(uint32_t) * 2 sizeof(uint32_t) * 3
); );
clip->animRawDataAssetId = data->animRawDataAssetId; clip->animRawDataAssetId = data->animRawDataAssetId;

View File

@ -313,7 +313,7 @@ namespace SHADE
.isSubAsset = true, .isSubAsset = true,
.parent = parent .parent = parent
}; };
auto& newClip {animContainer->clips.emplace_back()}; auto& newClip {animContainer->clips.emplace_back(new SHAnimClipAsset())};
newClip->name = name; newClip->name = name;
assetCollection.emplace(id, asset); assetCollection.emplace(id, asset);
assetCollection[parent].subAssets.push_back(&assetCollection[id]); assetCollection[parent].subAssets.push_back(&assetCollection[id]);