MotionAsset.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <Integration/Assets/AssetCommon.h>
  10. namespace EMotionFX
  11. {
  12. class Motion;
  13. class MotionInstance;
  14. namespace Integration
  15. {
  16. class MotionAsset : public EMotionFXAsset
  17. {
  18. public:
  19. AZ_RTTI(MotionAsset, "{00494B8E-7578-4BA2-8B28-272E90680787}", EMotionFXAsset)
  20. AZ_CLASS_ALLOCATOR_DECL
  21. MotionAsset(AZ::Data::AssetId id = AZ::Data::AssetId());
  22. void SetData(EMotionFX::Motion* motion); // Only Used for testing
  23. EMotionFXPtr<EMotionFX::Motion> m_emfxMotion;
  24. };
  25. class MotionAssetHandler : public EMotionFXAssetHandler<MotionAsset>
  26. {
  27. public:
  28. AZ_CLASS_ALLOCATOR_DECL
  29. bool OnInitAsset(const AZ::Data::Asset<AZ::Data::AssetData>& asset) override;
  30. AZ::Data::AssetType GetAssetType() const override;
  31. void GetAssetTypeExtensions(AZStd::vector<AZStd::string>& extensions) override;
  32. const char* GetAssetTypeDisplayName() const override;
  33. const char* GetBrowserIcon() const override;
  34. };
  35. } // namespace Integration
  36. } // namespace EMotionFX
  37. namespace AZ
  38. {
  39. AZ_TYPE_INFO_SPECIALIZE(EMotionFX::Integration::EMotionFXPtr<EMotionFX::Integration::MotionAsset>, "{B51E66B5-B576-432A-9D01-9C8DA4757CE9}");
  40. AZ_TYPE_INFO_SPECIALIZE(EMotionFX::Integration::EMotionFXPtr<EMotionFX::MotionInstance>, "{491DEAEE-A540-4187-A25F-743BEB74E01C}");
  41. }