TrackViewPythonFuncs.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. class SANDBOX_API TrackViewComponent final
  27. : public AZ::Component
  28. , public EditorLayerTrackViewRequestBus::Handler
  29. {
  30. public:
  31. AZ_COMPONENT(TrackViewComponent, "{3CF943CC-6F10-4B19-88FC-CFB697558FFD}")
  32. TrackViewComponent() = default;
  33. ~TrackViewComponent() override = default;
  34. static void Reflect(AZ::ReflectContext* context);
  35. // Component...
  36. void Activate() override;
  37. void Deactivate() override;
  38. int GetNumSequences() override;
  39. void NewSequence(const char* name, int sequenceType) override;
  40. void PlaySequence() override;
  41. void StopSequence() override;
  42. void SetSequenceTime(float time) override;
  43. void AddSelectedEntities() override;
  44. void AddLayerNode() override;
  45. void AddTrack(const char* paramName, const char* nodeName, const char* parentDirectorName) override;
  46. void DeleteTrack(const char* paramName, uint32 index, const char* nodeName, const char* parentDirectorName) override;
  47. int GetNumTrackKeys(const char* paramName, int trackIndex, const char* nodeName, const char* parentDirectorName) override;
  48. void SetRecording(bool bRecording) override;
  49. void DeleteSequence(const char* name) override;
  50. void SetCurrentSequence(const char* name) override;
  51. AZStd::string GetSequenceName(unsigned int index) override;
  52. TRange<float> GetSequenceTimeRange(const char* name) override;
  53. void AddNode(const char* nodeTypeString, const char* nodeName) override;
  54. void DeleteNode(AZStd::string_view nodeName, AZStd::string_view parentDirectorName) override;
  55. int GetNumNodes(AZStd::string_view parentDirectorName) override;
  56. AZStd::string GetNodeName(int index, AZStd::string_view parentDirectorName) override;
  57. AZStd::any GetKeyValue(const char* paramName, int trackIndex, int keyIndex, const char* nodeName, const char* parentDirectorName) override;
  58. AZStd::any GetInterpolatedValue(const char* paramName, int trackIndex, float time, const char* nodeName, const char* parentDirectorName) override;
  59. void SetSequenceTimeRange(const char* name, float start, float end) override;
  60. };
  61. } // namespace AzToolsFramework