diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp
index ee66c6c77..a8c091eb9 100644
--- a/Source/Engine/Level/Actors/AnimatedModel.cpp
+++ b/Source/Engine/Level/Actors/AnimatedModel.cpp
@@ -563,6 +563,20 @@ void AnimatedModel::StopSlotAnimation(const StringView& slotName, Animation* ani
}
}
+void AnimatedModel::StopSlotAnimation(const StringView& slotName)
+{
+ for (auto& slot : GraphInstance.Slots)
+ {
+ if (slot.Name == slotName)
+ {
+ //slot.Animation = nullptr; // TODO: make an immediate version of this method and set the animation to nullptr.
+ if (slot.Animation != nullptr)
+ slot.Reset = true;
+ break;
+ }
+ }
+}
+
void AnimatedModel::PauseSlotAnimation()
{
for (auto& slot : GraphInstance.Slots)
@@ -601,6 +615,16 @@ bool AnimatedModel::IsPlayingSlotAnimation(const StringView& slotName, Animation
return false;
}
+bool AnimatedModel::IsPlayingSlotAnimation(const StringView& slotName)
+{
+ for (auto& slot : GraphInstance.Slots)
+ {
+ if (slot.Name == slotName && !slot.Pause)
+ return true;
+ }
+ return false;
+}
+
void AnimatedModel::ApplyRootMotion(const Transform& rootMotionDelta)
{
// Skip if no motion
diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h
index a011be0d0..dc837c658 100644
--- a/Source/Engine/Level/Actors/AnimatedModel.h
+++ b/Source/Engine/Level/Actors/AnimatedModel.h
@@ -414,6 +414,12 @@ public:
/// The name of the slot.
/// The animation to stop.
API_FUNCTION() void StopSlotAnimation(const StringView& slotName, Animation* anim);
+
+ ///
+ /// Stops the animation playback on the slot in Anim Graph.
+ ///
+ /// The name of the slot.
+ API_FUNCTION() void StopSlotAnimation(const StringView& slotName);
///
/// Pauses all the animations playback on the all slots in Anim Graph.
@@ -439,6 +445,12 @@ public:
/// The animation to check.
API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName, Animation* anim);
+ ///
+ /// Checks if the animation playback is active on the slot in Anim Graph (not paused).
+ ///
+ /// The name of the slot.
+ API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName);
+
private:
void ApplyRootMotion(const Transform& rootMotionDelta);
void SyncParameters();