We encountered an issue that lead to a crash in the Editor while using ControlRig and Sequencer but we cannot provide a repro.
That’s why I am just going to point out the code that seems to be the issue.
When FAnimInstanceProxy::ResetCounterInputProxy is called, it resets the CachedBonesCounter but multiple animation nodes (like AnimNode_BlendStack) also keep their own counter for comparison purposes.
This eventually leads to an incorrect result when IsSynchronized_All to check if those nodes should update their cache.
I believe ResetCounterInputProxy should also reset the counters of the animation nodes.
Thanks for raising this. I chatted with the dev team. ResetCounterInputProxy is kind of a hack to handle some issues with the control specifically. So we don’t recommend using it for all animation nodes, which is part of why we haven’t implemented it and are fixing other issues around the cached bones counter. That said, we’ve made many fixes for Control Rig because of the under-the-hood internal changes we made for 5.8. If you can share the crash log, it would help us determine whether we’ve already fixed this.
We are not calling it ourselves as far as I know. Looking at the callstack, it’s called by the Sequencer.
FAnimInstanceProxy::ResetCounterInputProxy(FAnimInstanceProxy * InputProxy) Line 3755 C++
FControlRigLayerInstanceProxy::ResetCounter(FAnimInstanceProxy *) Line 407 C++
FAnimNode_ControlRigInputPose::Link(UAnimInstance * InInputInstance, FAnimInstanceProxy *) Line 524 C++
FControlRigLayerInstanceProxy::SetSourceAnimInstance(UAnimInstance * SourceAnimInstance, FAnimInstanceProxy * SourceAnimInputProxy) Line 195 C++
FAnimCustomInstanceHelper::BindToSkeletalMeshComponent<UControlRigLayerInstance>(USkeletalMeshComponent * InSkeletalMeshComponent, bool & bOutWasCreated) Line 186 C++
FControlRigBindingHelper::BindToSequencerInstance(UControlRig * ControlRig) Line 608 C++
FControlRigParameterExecutionToken::Execute(const FMovieSceneContext & Context, const FMovieSceneEvaluationOperand & Operand, FPersistentEvaluationData & PersistentData, IMovieScenePlayer & Player) Line 1341 C++
FMovieSceneExecutionTokens::Apply(const FMovieSceneContext & RootContext, IMovieScenePlayer & Player) Line 60 C++
FMovieSceneTrackEvaluator::EvaluateGroup(const FMovieSceneEvaluationGroup & Group, const FMovieSceneContext & RootContext, IMovieScenePlayer & Player) Line 242 C++
FMovieSceneTrackEvaluator::Evaluate(FMovieSceneContext Context, IMovieScenePlayer & Player, FMovieSceneSequenceID InOverrideRootID) Line 146 C++
UE::MovieScene::FSequenceInstance::RunLegacyTrackTemplates() Line 432 C++
FMovieSceneEntitySystemRunner::GameThread_EvaluationFinalizationPhase(UMovieSceneEntitySystemLinker * Linker) Line 1260 C++
FMovieSceneEntitySystemRunner::FlushNext(UMovieSceneEntitySystemLinker * Linker) Line 448 C++
FMovieSceneEntitySystemRunner::FlushOutstanding(double BudgetMs, UE::MovieScene::ERunnerFlushState TargetState) Line 584 C++
FMovieSceneRootEvaluationTemplateInstance::EvaluateSynchronousBlocking(FMovieSceneContext Context) Line 213 C++
FSequencer::EvaluateInternal(FMovieSceneEvaluationRange InRange, bool bHasJumped) Line 3898 C++
FSequencer::Tick(float InDeltaTime) Line 1308 C++