diff --git a/SHADE_Engine/src/Animation/SHAnimationClip.cpp b/SHADE_Engine/src/Animation/SHAnimationClip.cpp index 666c548d..4dab967c 100644 --- a/SHADE_Engine/src/Animation/SHAnimationClip.cpp +++ b/SHADE_Engine/src/Animation/SHAnimationClip.cpp @@ -28,7 +28,7 @@ namespace SHADE { // Create a channel Channel newChannel; - newChannel.Name = channel.name; + newChannel.Name = std::string(channel.name); newChannel.PositionKeyFrames.reserve(channel.positionKeys.size()); newChannel.RotationKeyFrames.reserve(channel.rotationKeys.size()); newChannel.ScaleKeyFrames.reserve(channel.scaleKeys.size()); diff --git a/SHADE_Engine/src/Animation/SHAnimationClip.h b/SHADE_Engine/src/Animation/SHAnimationClip.h index fa8466b8..8a10ce3a 100644 --- a/SHADE_Engine/src/Animation/SHAnimationClip.h +++ b/SHADE_Engine/src/Animation/SHAnimationClip.h @@ -11,9 +11,8 @@ of DigiPen Institute of Technology is prohibited. *//*************************************************************************************/ #pragma once -// STL Includes - // Project Includes +#include "SH_API.h" #include "Math/SHMatrix.h" #include "Assets/Asset Types/Models/SHAnimationAsset.h" @@ -36,7 +35,7 @@ namespace SHADE /// Represents a animation clip of a 3D animation that is made for a specific model /// rig. /// - class SHAnimationClip + class SH_API SHAnimationClip { public: /*---------------------------------------------------------------------------------*/ diff --git a/SHADE_Engine/src/Animation/SHRig.cpp b/SHADE_Engine/src/Animation/SHRig.cpp index 0d777c27..81c3e3de 100644 --- a/SHADE_Engine/src/Animation/SHRig.cpp +++ b/SHADE_Engine/src/Animation/SHRig.cpp @@ -27,7 +27,10 @@ namespace SHADE { // Don't bother if empty if (asset.root == nullptr) + { + SHLOG_ERROR("[SHRig] Attempted to load an invalid rig with no root."); return; + } // Do a recursive depth first traversal to populate the rig nodeCount = 0; diff --git a/SHADE_Engine/src/Animation/SHRig.h b/SHADE_Engine/src/Animation/SHRig.h index 66bb37ad..0dc9c829 100644 --- a/SHADE_Engine/src/Animation/SHRig.h +++ b/SHADE_Engine/src/Animation/SHRig.h @@ -17,6 +17,7 @@ of DigiPen Institute of Technology is prohibited. #include // Project Includes +#include "SH_API.h" #include "Math/SHMatrix.h" #include "Resource/SHHandle.h" #include "Resource/SHResourceLibrary.h" @@ -32,7 +33,7 @@ namespace SHADE /*-----------------------------------------------------------------------------------*/ /* Type Definitions */ /*-----------------------------------------------------------------------------------*/ - class SHRig + class SH_API SHRig { public: /*---------------------------------------------------------------------------------*/ diff --git a/SHADE_Engine/src/Resource/SHResourceManager.h b/SHADE_Engine/src/Resource/SHResourceManager.h index 086b8570..3b9089a2 100644 --- a/SHADE_Engine/src/Resource/SHResourceManager.h +++ b/SHADE_Engine/src/Resource/SHResourceManager.h @@ -51,8 +51,8 @@ namespace SHADE template<> struct SHResourceLoader { using AssetType = SHMaterialAsset; }; template<> struct SHResourceLoader { using AssetType = SHMaterialSpec; }; template<> struct SHResourceLoader { using AssetType = SHFontAsset; }; - template<> struct SHResourceLoader { using AssetType = SHAnimAsset; }; - template<> struct SHResourceLoader { using AssetType = SHRigAsset; }; + template<> struct SHResourceLoader { using AssetType = SHModelAsset; }; + template<> struct SHResourceLoader { using AssetType = SHModelAsset; }; /// /// Static class responsible for loading and caching runtime resources from their diff --git a/SHADE_Engine/src/Resource/SHResourceManager.hpp b/SHADE_Engine/src/Resource/SHResourceManager.hpp index 44c38c50..5aff2529 100644 --- a/SHADE_Engine/src/Resource/SHResourceManager.hpp +++ b/SHADE_Engine/src/Resource/SHResourceManager.hpp @@ -348,10 +348,15 @@ namespace SHADE return gfxSystem->AddFont(assetData); } // Animation Clip and Rig - else + else if constexpr (std::is_same_v) { loadedAssetData.emplace_back(assetId); - return resourceHub.Create(assetData); + return resourceHub.Create(assetData.rig); + } + else if constexpr (std::is_same_v) + { + loadedAssetData.emplace_back(assetId); + return resourceHub.Create(*assetData.anims[0]); } } }