TrackViewPythonFuncs.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 <AzCore/Component/Component.h>
  10. #include <Include/SandboxAPI.h>
  11. #include "EditorTrackViewEventsBus.h"
  12. namespace AzToolsFramework
  13. {
  14. //! A legacy component to reflect scriptable commands for the Editor
  15. class TrackViewFuncsHandler
  16. : public AZ::Component
  17. {
  18. public:
  19. AZ_COMPONENT(TrackViewFuncsHandler, "{5315678D-2951-4CF6-A9DC-CE21CD23C9C9}")
  20. SANDBOX_API static void Reflect(AZ::ReflectContext* context);
  21. // AZ::Component ...
  22. void Activate() override {}
  23. void Deactivate() override {}
  24. };
  25. //! Component to access the TrackView
  26. AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  27. AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
  28. class SANDBOX_API TrackViewComponent final
  29. : public AZ::Component
  30. , public EditorLayerTrackViewRequestBus::Handler
  31. {
  32. AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
  33. AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  34. public:
  35. AZ_COMPONENT(TrackViewComponent, "{3CF943CC-6F10-4B19-88FC-CFB697558FFD}")
  36. TrackViewComponent() = default;
  37. ~TrackViewComponent() override = default;
  38. static void Reflect(AZ::ReflectContext* context);
  39. // Component...
  40. void Activate() override;
  41. void Deactivate() override;
  42. int GetNumSequences() override;
  43. void NewSequence(const char* name, int sequenceType) override;
  44. void PlaySequence() override;
  45. void StopSequence() override;
  46. void SetSequenceTime(float time) override;
  47. void AddSelectedEntities() override;
  48. void AddLayerNode() override;
  49. void AddTrack(const char* paramName, const char* nodeName, const char* parentDirectorName) override;
  50. void DeleteTrack(const char* paramName, uint32 index, const char* nodeName, const char* parentDirectorName) override;
  51. int GetNumTrackKeys(const char* paramName, int trackIndex, const char* nodeName, const char* parentDirectorName) override;
  52. void SetRecording(bool bRecording) override;
  53. void DeleteSequence(const char* name) override;
  54. void SetCurrentSequence(const char* name) override;
  55. AZStd::string GetSequenceName(unsigned int index) override;
  56. TRange<float> GetSequenceTimeRange(const char* name) override;
  57. void AddNode(const char* nodeTypeString, const char* nodeName) override;
  58. void DeleteNode(AZStd::string_view nodeName, AZStd::string_view parentDirectorName) override;
  59. int GetNumNodes(AZStd::string_view parentDirectorName) override;
  60. AZStd::string GetNodeName(int index, AZStd::string_view parentDirectorName) override;
  61. AZStd::any GetKeyValue(const char* paramName, int trackIndex, int keyIndex, const char* nodeName, const char* parentDirectorName) override;
  62. AZStd::any GetInterpolatedValue(const char* paramName, int trackIndex, float time, const char* nodeName, const char* parentDirectorName) override;
  63. void SetSequenceTimeRange(const char* name, float start, float end) override;
  64. };
  65. } // namespace AzToolsFramework