AnimationGroup.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 <SceneAPI/SceneCore/Components/BehaviorComponent.h>
  10. #include <SceneAPI/SceneCore/Events/ManifestMetaInfoBus.h>
  11. #include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
  12. namespace AZ
  13. {
  14. namespace SceneAPI
  15. {
  16. namespace Behaviors
  17. {
  18. class AnimationGroup
  19. : public SceneCore::BehaviorComponent
  20. , public Events::ManifestMetaInfoBus::Handler
  21. , public Events::AssetImportRequestBus::Handler
  22. {
  23. public:
  24. AZ_COMPONENT(AnimationGroup, "{CE7FEBE4-ACA3-41B8-9154-9B9E09A95A06}", SceneCore::BehaviorComponent);
  25. ~AnimationGroup() override = default;
  26. void Activate() override;
  27. void Deactivate() override;
  28. static void Reflect(ReflectContext* context);
  29. // ManifestMetaInfo
  30. void GetCategoryAssignments(CategoryRegistrationList& categories, const Containers::Scene& scene) override;
  31. void InitializeObject(const Containers::Scene& scene, DataTypes::IManifestObject& target) override;
  32. // AssetImportRequest
  33. Events::ProcessingResult UpdateManifest(Containers::Scene& scene, ManifestAction action,
  34. RequestingApplication requester) override;
  35. void GetPolicyName(AZStd::string& result) const override
  36. {
  37. result = "AnimationGroup";
  38. }
  39. private:
  40. Events::ProcessingResult BuildDefault(Containers::Scene& scene) const;
  41. Events::ProcessingResult UpdateAnimationGroups(Containers::Scene& scene) const;
  42. bool SceneHasAnimationGroup(const Containers::Scene& scene) const;
  43. static constexpr int s_animationsPreferredTabOrder{ 2 };
  44. };
  45. } // namespace Behaviors
  46. } // namespace SceneAPI
  47. } // namespace AZ