123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #include <AzCore/std/any.h>
- namespace AzToolsFramework
- {
- /**
- * This bus can be used to send commands to the track view.
- */
- class EditorLayerTrackViewRequests
- : public AZ::ComponentBus
- {
- public:
- /**
- * Gets the number of sequences.
- */
- virtual int GetNumSequences() = 0;
- /**
- * Creates a new sequence of the given type(0 = Object Entity Sequence(Legacy), 1 = Component Entity Sequence(PREVIEW)) with the given name.
- */
- virtual void NewSequence(const char* name, int sequenceType) = 0;
- /**
- * Plays the current sequence in TrackView.
- */
- virtual void PlaySequence() = 0;
- /**
- * Stops any sequence currently playing in TrackView.
- */
- virtual void StopSequence() = 0;
- /**
- * Sets the time of the sequence currently playing in TrackView.
- */
- virtual void SetSequenceTime(float time) = 0;
- /**
- * Adds an entity node(s) from viewport selection to the current sequence.
- */
- virtual void AddSelectedEntities() = 0;
- /**
- * Adds a layer node from the current layer to the current sequence.
- */
- virtual void AddLayerNode() = 0;
- /**
- * Adds a track of the given parameter ID to the node.
- */
- virtual void AddTrack(const char* paramName, const char* nodeName, const char* parentDirectorName) = 0;
- /**
- * Deletes a track of the given parameter ID (in the given index in case of a multi-track) from the node.
- */
- virtual void DeleteTrack(const char* paramName, uint32 index, const char* nodeName, const char* parentDirectorName) = 0;
- /**
- * Gets number of keys of the specified track.
- */
- virtual int GetNumTrackKeys(const char* paramName, int trackIndex, const char* nodeName, const char* parentDirectorName) = 0;
- /**
- * Activates/deactivates TrackView recording mode.
- */
- virtual void SetRecording(bool bRecording) = 0;
- /**
- * Deletes the specified sequence.
- */
- virtual void DeleteSequence(const char* name) = 0;
- /**
- * Sets the specified sequence as a current one in TrackView.
- */
- virtual void SetCurrentSequence(const char* name) = 0;
- /**
- * Gets the name of a sequence by its index.
- */
- virtual AZStd::string GetSequenceName(unsigned int index) = 0;
- /**
- * Gets the time range of a sequence as a pair.
- */
- virtual TRange<float> GetSequenceTimeRange(const char* name) = 0;
- /**
- * Adds a new node with the given type & name to the current sequence.
- */
- virtual void AddNode(const char* nodeTypeString, const char* nodeName) = 0;
- /**
- * Deletes the specified node from the current sequence.
- */
- virtual void DeleteNode(AZStd::string_view nodeName, AZStd::string_view parentDirectorName) = 0;
- /**
- * Gets the number of nodes.
- */
- virtual int GetNumNodes(AZStd::string_view parentDirectorName) = 0;
- /**
- * Gets the name of a sequence by its index.
- */
- virtual AZStd::string GetNodeName(int index, AZStd::string_view parentDirectorName) = 0;
- /**
- * Gets the value of the specified key.
- */
- virtual AZStd::any GetKeyValue(const char* paramName, int trackIndex, int keyIndex, const char* nodeName, const char* parentDirectorName) = 0;
- /**
- * Gets the interpolated value of a track at the specified time.
- */
- virtual AZStd::any GetInterpolatedValue(const char* paramName, int trackIndex, float time, const char* nodeName, const char* parentDirectorName) = 0;
- /**
- * Sets the time range of a sequence.
- */
- virtual void SetSequenceTimeRange(const char* name, float start, float end) = 0;
- };
- using EditorLayerTrackViewRequestBus = AZ::EBus<EditorLayerTrackViewRequests>;
- }
|