Implemented Animation Clip asset and animation controller #410
|
@ -308,6 +308,7 @@ namespace SHADE
|
||||||
auto& newClip {animContainer->clips.emplace_back()};
|
auto& newClip {animContainer->clips.emplace_back()};
|
||||||
newClip.name = name;
|
newClip.name = name;
|
||||||
assetCollection.emplace(id, asset);
|
assetCollection.emplace(id, asset);
|
||||||
|
assetCollection[parent].subAssets.push_back(&assetCollection[id]);
|
||||||
assetData.emplace(id, &newClip);
|
assetData.emplace(id, &newClip);
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,13 +249,26 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
std::vector<Handle<SHAnimationClip>> animClips;
|
std::vector<Handle<SHAnimationClip>> animClips;
|
||||||
|
|
||||||
const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CLIP);
|
//const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CLIP);
|
||||||
for (auto asset : ALL_ANIM_CLIPS)
|
//for (auto asset : ALL_ANIM_CLIPS)
|
||||||
|
//{
|
||||||
|
// const SHAnimClipAsset* ANIM_CLIP = SHAssetManager::GetData<SHAnimClipAsset>(asset.id);
|
||||||
|
// if (ANIM_CLIP->animRawDataAssetId == rawAnimId)
|
||||||
|
// {
|
||||||
|
// animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(asset.id));
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
const auto ALL_ANIM_CLIPS = SHAssetManager::GetAllRecordOfType(AssetType::ANIM_CONTAINER);
|
||||||
|
for (auto const& asset : ALL_ANIM_CLIPS)
|
||||||
{
|
{
|
||||||
const SHAnimClipAsset* ANIM_CLIP = SHAssetManager::GetData<SHAnimClipAsset>(asset.id);
|
auto const ANIM_CLIP {SHAssetManager::GetData<SHAnimClipContainerAsset>(asset.id)};
|
||||||
if (ANIM_CLIP->animRawDataAssetId == rawAnimId)
|
if (ANIM_CLIP->animRawDataAssetId == rawAnimId)
|
||||||
{
|
{
|
||||||
animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(asset.id));
|
for (auto const& subAsset : asset.subAssets)
|
||||||
|
{
|
||||||
|
animClips.emplace_back(SHResourceManager::LoadOrGet<SHAnimationClip>(subAsset->id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue