BlendShapeRuleBehavior.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <AzCore/std/string/string.h>
  11. #include <SceneAPI/SceneCore/Events/ManifestMetaInfoBus.h>
  12. #include <SceneAPI/SceneCore/Events/AssetImportRequest.h>
  13. namespace AZ
  14. {
  15. namespace SceneAPI
  16. {
  17. namespace DataTypes
  18. {
  19. class IGroup;
  20. class ISceneNodeSelectionList;
  21. }
  22. namespace SceneData
  23. {
  24. class BlendShapeRuleBehavior
  25. : public SceneCore::BehaviorComponent
  26. , public Events::ManifestMetaInfoBus::Handler
  27. , public Events::AssetImportRequestBus::Handler
  28. {
  29. public:
  30. AZ_COMPONENT(BlendShapeRuleBehavior, "{D07DABE6-D731-4F4F-B55E-019EDE5B435E}", SceneCore::BehaviorComponent);
  31. ~BlendShapeRuleBehavior() override = default;
  32. void Activate() override;
  33. void Deactivate() override;
  34. static void Reflect(ReflectContext* context);
  35. void InitializeObject(const Containers::Scene& scene, DataTypes::IManifestObject& target) override;
  36. Events::ProcessingResult UpdateManifest(Containers::Scene& scene, ManifestAction action,
  37. RequestingApplication requester) override;
  38. void GetPolicyName(AZStd::string& result) const override
  39. {
  40. result = "BlendShapeRuleBehavior";
  41. }
  42. private:
  43. size_t SelectBlendShapes(const Containers::Scene& scene, DataTypes::ISceneNodeSelectionList& selection) const;
  44. void UpdateBlendShapeRules(Containers::Scene& scene) const;
  45. };
  46. } // namespace SceneData
  47. } // namespace SceneAPI
  48. } // namespace AZ