Hello!
We have animated skeletal meshes bound in a Level Subsequence with additive Control Rig tracks, and the subsequence is starting before the first frame. We’ve found several simple actions, such as generating Camera Cut thumbnails or dragging the playhead off and then back onto the playable range of the subsequence results in a temporary AnimScriptInstance being cached/restored to our skeletal meshes, breaking the skeletal meshes’ connection to their Animation Blueprint (and thus breaking slots/blending).
It appears Skeletal Meshes that have additive Control Rigs have ```FAnimCustomInstanceHelper::BindToSkeletalMeshComponent``` and ```FAnimCustomInstanceHelper::UnbindFromSkeletalMeshComponent``` called on them repeatedly on initialization, assigning and then unassigning ControlRigLayerInstances that then use the mesh’s default AnimInstance as the SourceAnimInstance. This appears normal.
However, we noticed that in the case where our content subsequences that house animations and ControlRigs are nudged in the negative from the first frame of our root, we’re pretty consistently seeing the following callstack occuring while that temporary ControlRigLayerInstance is assigned, caching it incorrectly instead of our Animation Blueprint instance:
UE::MovieScene::FPreAnimatedSkeletalAnimationTraits::CachePreAnimatedValue(const FObjectKey &) MovieSceneSkeletalAnimationSystem.cpp:97 [Inlined] UE::MovieScene::TPreAnimatedStateStorage_ObjectTraits::CachePreAnimatedValue(const UE::MovieScene::FCachePreAnimatedValueParams &, const UE::MovieScene::FPreAnimatedStateEntry &, UObject *) MovieScenePreAnimatedObjectStorage.h:186 UE::MovieScene::TPreAnimatedStateStorage_ObjectTraits::CachePreAnimatedValue(const UE::MovieScene::FCachePreAnimatedValueParams &, UObject *, EPreAnimatedCaptureSourceTracking) MovieScenePreAnimatedObjectStorage.h:175 UE::MovieScene::FEvaluateSkeletalAnimations::EvaluateSkeletalAnimations(USkeletalMeshComponent *, const UE::MovieScene::FBoundObjectActiveSkeletalAnimations &) MovieSceneSkeletalAnimationSystem.cpp:515 UE::MovieScene::FEvaluateSkeletalAnimations::Run() MovieSceneSkeletalAnimationSystem.cpp:489 UE::MovieScene::FScheduledTask::Run(const UE::MovieScene::FEntitySystemScheduler *, FTaskExecutionFlags) MovieSceneTaskScheduler.cpp:101 UE::MovieScene::FEntitySystemScheduler::PrerequisiteCompleted(const UE::MovieScene::FScheduledTask *, int *) MovieSceneTaskScheduler.cpp:650 [Inlined] UE::MovieScene::FEntitySystemScheduler::PrerequisiteCompleted(FTaskID, int *) MovieSceneTaskScheduler.cpp:627 UE::MovieScene::FEntitySystemScheduler::CompleteTask(const UE::MovieScene::FScheduledTask *, FTaskExecutionFlags) MovieSceneTaskScheduler.cpp:599 UE::MovieScene::FScheduledTask::Run(const UE::MovieScene::FEntitySystemScheduler *, FTaskExecutionFlags) MovieSceneTaskScheduler.cpp:160 UE::MovieScene::FEntitySystemScheduler::ExecuteTasks() MovieSceneTaskScheduler.cpp:494 [Inlined] FMovieSceneEntitySystemGraph::ScheduleTasks(UE::MovieScene::FEntityManager *) MovieSceneEntitySystemGraphs.cpp:593 FMovieSceneEntitySystemRunner::GameThread_EvaluationPhase(UMovieSceneEntitySystemLinker *) MovieSceneEntitySystemRunner.cpp:1077 FMovieSceneEntitySystemRunner::FlushNext(UMovieSceneEntitySystemLinker *) MovieSceneEntitySystemRunner.cpp:375 FMovieSceneEntitySystemRunner::FlushOutstanding(double, ERunnerFlushState) MovieSceneEntitySystemRunner.cpp:512 FMovieSceneRootEvaluationTemplateInstance::EvaluateSynchronousBlocking(FMovieSceneContext) MovieSceneEvaluationTemplateInstance.cpp:186 FSequencer::EvaluateInternal(FMovieSceneEvaluationRange, bool) Sequencer.cpp:3554 FSequencer::Tick(float) Sequencer.cpp:1097
This will then be restored incorrectly to our mesh, and when trying to create an AnimSequencerInstance to interact with Sequencer, we don’t have a valid SourceAnimInstance to supply to the new instance, so Sequencer will just play the animation tracks with no blending.
Also, at this point, nothing expects to restore our animation instance to the original AnimBP instance, so it stays in a bad state until something resets the AnimInstance back to an instance of the Animation Blueprint.
Any help in finding a fix for this would be appreciated.
Andres