diff --git a/Source/Engine/Animations/Animations.cpp b/Source/Engine/Animations/Animations.cpp index 033659948..359334da2 100644 --- a/Source/Engine/Animations/Animations.cpp +++ b/Source/Engine/Animations/Animations.cpp @@ -73,6 +73,7 @@ void AnimationsSystem::Job(int32 index) { dt = t - lastUpdateTime; } + dt *= animatedModel->UpdateSpeed; animatedModel->GraphInstance.LastUpdateTime = t; // Evaluate animated nodes pose diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp index 3c41bdb9f..7b85d8e72 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.cpp +++ b/Source/Engine/Level/Actors/AnimatedModel.cpp @@ -665,6 +665,7 @@ void AnimatedModel::Serialize(SerializeStream& stream, const void* otherObj) SERIALIZE(PerBoneMotionBlur); SERIALIZE(UseTimeScale); SERIALIZE(UpdateWhenOffscreen); + SERIALIZE(UpdateSpeed); SERIALIZE(UpdateMode); SERIALIZE(BoundsScale); SERIALIZE(CustomBounds); @@ -688,6 +689,7 @@ void AnimatedModel::Deserialize(DeserializeStream& stream, ISerializeModifier* m DESERIALIZE(PerBoneMotionBlur); DESERIALIZE(UseTimeScale); DESERIALIZE(UpdateWhenOffscreen); + DESERIALIZE(UpdateSpeed); DESERIALIZE(UpdateMode); DESERIALIZE(BoundsScale); DESERIALIZE(CustomBounds); diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h index 771833f2c..d584250b6 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.h +++ b/Source/Engine/Level/Actors/AnimatedModel.h @@ -99,6 +99,12 @@ public: API_FIELD(Attributes="EditorOrder(40), DefaultValue(false), EditorDisplay(\"Skinned Model\")") bool UpdateWhenOffscreen = false; + /// + /// The animation update delta time scale. Can be used to speed up animation playback or create slow motion effect. + /// + API_FIELD(Attributes="EditorOrder(45), EditorDisplay(\"Skinned Model\")") + float UpdateSpeed = 1.0f; + /// /// The animation update mode. Can be used to optimize the performance. ///