Implemented Animation Clip asset and animation controller #410

Merged
XiaoQiDigipen merged 66 commits from SP3-22-AnimationController into main 2023-03-09 16:19:40 +08:00
2 changed files with 105 additions and 81 deletions
Showing only changes of commit 43edfeb14f - Show all commits

View File

@ -23,6 +23,9 @@ of DigiPen Institute of Technology is prohibited.
#include "Assets/MeshAsset.hxx"
#include "Scripts/Script.hxx"
#include "Scripts/ScriptStore.hxx"
#include "Assets/AnimationClipAsset.hxx"
#include "Assets/AnimationControllerAsset.hxx"
#include "Assets/AnimationRigAsset.hxx"
/*-------------------------------------------------------------------------------------*/
/* File-Level Constants */
@ -181,7 +184,10 @@ namespace SHADE
fieldInsertYaml<GameObject > (fieldInfo, object, fieldNode) ||
fieldInsertYaml<FontAsset > (fieldInfo, object, fieldNode) ||
fieldInsertYaml<MaterialAsset > (fieldInfo, object, fieldNode) ||
fieldInsertYaml<MeshAsset >(fieldInfo, object, fieldNode);
fieldInsertYaml<MeshAsset > (fieldInfo, object, fieldNode) ||
fieldInsertYaml<AnimationClipAsset> (fieldInfo, object, fieldNode) ||
fieldInsertYaml<AnimationControllerAsset>(fieldInfo, object, fieldNode) ||
fieldInsertYaml<AnimationRigAsset> (fieldInfo, object, fieldNode);
// Serialization of more complex types
if (!PRIMITIVE_SERIALIZED)
@ -245,7 +251,10 @@ namespace SHADE
varInsertYamlInternal<GameObject >(object, fieldNode) ||
varInsertYamlInternal<FontAsset >(object, fieldNode) ||
varInsertYamlInternal<MaterialAsset >(object, fieldNode) ||
varInsertYamlInternal<MeshAsset >(object, fieldNode);
varInsertYamlInternal<MeshAsset >(object, fieldNode) ||
varInsertYamlInternal<AnimationClipAsset >(object, fieldNode) ||
varInsertYamlInternal<AnimationRigAsset >(object, fieldNode) ||
varInsertYamlInternal<AnimationControllerAsset>(object, fieldNode);
return INSERTED;
}
@ -272,7 +281,10 @@ namespace SHADE
fieldAssignYaml<GameObject >(fieldInfo, object, node) ||
fieldAssignYaml<FontAsset >(fieldInfo, object, node) ||
fieldAssignYaml<MaterialAsset >(fieldInfo, object, node) ||
fieldAssignYaml<MeshAsset> (fieldInfo, object, node);
fieldAssignYaml<MeshAsset >(fieldInfo, object, node) ||
fieldAssignYaml<AnimationClipAsset >(fieldInfo, object, node) ||
fieldAssignYaml<AnimationRigAsset >(fieldInfo, object, node) ||
fieldAssignYaml<AnimationControllerAsset>(fieldInfo, object, node);
if (!ASSIGNED)
{
if (ReflectionUtilities::FieldIsList(fieldInfo))
@ -346,7 +358,10 @@ namespace SHADE
varAssignYamlInternal<GameObject >(object, node) ||
varAssignYamlInternal<FontAsset >(object, node) ||
varAssignYamlInternal<MaterialAsset >(object, node) ||
varAssignYamlInternal<MeshAsset> (object, node);
varAssignYamlInternal<MeshAsset >(object, node) ||
varAssignYamlInternal<AnimationClipAsset >(object, node) ||
varAssignYamlInternal<AnimationRigAsset >(object, node) ||
varAssignYamlInternal<AnimationControllerAsset>(object, node);
return DESERIALISED;
}
}

View File

@ -62,7 +62,10 @@ namespace SHADE
}
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
std::is_same_v<FieldType, MaterialAsset> ||
std::is_same_v<FieldType, MeshAsset>)
std::is_same_v<FieldType, MeshAsset> ||
std::is_same_v<FieldType, AnimationClipAsset> ||
std::is_same_v<FieldType, AnimationControllerAsset> ||
std::is_same_v<FieldType, AnimationRigAsset>)
{
fieldNode = INVALID_ASSET_ID;
}
@ -130,7 +133,10 @@ namespace SHADE
}
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
std::is_same_v<FieldType, MaterialAsset> ||
std::is_same_v<FieldType, MeshAsset>)
std::is_same_v<FieldType, MeshAsset> ||
std::is_same_v<FieldType, AnimationClipAsset> ||
std::is_same_v<FieldType, AnimationControllerAsset> ||
std::is_same_v<FieldType, AnimationRigAsset>)
{
if (object->GetType() == FieldType::typeid)
{
@ -256,7 +262,10 @@ namespace SHADE
}
else if constexpr (std::is_same_v<FieldType, FontAsset> ||
std::is_same_v<FieldType, MaterialAsset> ||
std::is_same_v<FieldType, MeshAsset>)
std::is_same_v<FieldType, MeshAsset> ||
std::is_same_v<FieldType, AnimationClipAsset> ||
std::is_same_v<FieldType, AnimationControllerAsset> ||
std::is_same_v<FieldType, AnimationRigAsset>)
{
if (object->GetType() == FieldType::typeid)
{