SkinGroup.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/GraphMetaInfoBus.h>
  12. #include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
  13. namespace AZ
  14. {
  15. namespace SceneAPI
  16. {
  17. namespace Behaviors
  18. {
  19. class SkinGroup
  20. : public SceneCore::BehaviorComponent
  21. , public Events::ManifestMetaInfoBus::Handler
  22. , public Events::GraphMetaInfoBus::Handler
  23. , public Events::AssetImportRequestBus::Handler
  24. {
  25. public:
  26. AZ_COMPONENT(SkinGroup, "{348566F7-7113-4CEB-ADF8-C1CC686CD3BD}", SceneCore::BehaviorComponent);
  27. static Crc32 s_skinVirtualType;
  28. static const char* s_skinVirtualTypeName;
  29. ~SkinGroup() override = default;
  30. void Activate() override;
  31. void Deactivate() override;
  32. static void Reflect(ReflectContext* context);
  33. void GetCategoryAssignments(CategoryRegistrationList& categories, const Containers::Scene& scene) override;
  34. void InitializeObject(const Containers::Scene& scene, DataTypes::IManifestObject& target) override;
  35. Events::ProcessingResult UpdateManifest(Containers::Scene& scene, ManifestAction action,
  36. RequestingApplication requester) override;
  37. void GetVirtualTypes(Events::GraphMetaInfo::VirtualTypesSet& types, const Containers::Scene& scene,
  38. Containers::SceneGraph::NodeIndex node) override;
  39. void GetAllVirtualTypes(Events::GraphMetaInfo::VirtualTypesSet& types) override;
  40. void GetVirtualTypeName(AZStd::string& name, Crc32 type) override;
  41. void GetPolicyName(AZStd::string& result) const override
  42. {
  43. result = "SkinGroup";
  44. }
  45. private:
  46. Events::ProcessingResult BuildDefault(Containers::Scene& scene) const;
  47. Events::ProcessingResult UpdateGroups(Containers::Scene& scene) const;
  48. bool SceneHasSkinGroup(const Containers::Scene& scene) const;
  49. static const int s_rigsPreferredTabOrder;
  50. };
  51. } // namespace Behaviors
  52. } // namespace SceneAPI
  53. } // namespace AZ