Hello Epic Support,
We are currently investigating ways to reduce the overhead associated with Sequencer faceboard ControlRig tracks bound to MetaHuman actors.
While regular ControlRig evaluation performs well, shot transitions consistently exceed our frame budget and introduce noticeable hitches that negatively impact the perceived continuity of our cinematics. After profiling several transitions, ControlRig initialization appeared to be the primary contributor, so we performed a deeper analysis to understand the initialization cost and identify potential optimization opportunities.
Our tests are made using both the ControlRig EvalTemplate and MovieSceneEntitySystem. We use a vanilla UE_5.6.1 but looking at the code from UE_5.7.4 and UE_5.8.0-preview-1, it is very likely that our conclusion apply to these versions as well.
For a single faceboard ControlRig on a single MetaHuman in a Development (non-Editor) build, we measured the following costs during initialization:
- `ControlRig->Initialize()` - ~1.5–2.0 ms
- `ControlRig->RequestInit()` - negligible
- `ControlRig->SetBoneInitialTransformsFromSkeletalMeshComponent(SkeletalMeshComponent, true)` - ~1.0 ms
- `ControlRig->Evaluate_AnyThread()` - ~2.5 ms (primarily due to the Construction Event)
- Control selection restoration - negligible
This results in a total initialization cost of approximately 5 ms per ControlRig. However, during our investigation, we noticed that this initialization sequence appears to be executed twice:
- Before `SavePreAnimatedState()` in `FControlRigParameterExecutionToken::Execute()` / `UMovieSceneControlRigParameterEvaluatorSystem::InitializeBaseRigComponent()`
- During `FControlRigBindingHelper::BindToSequencerInstance()`, when creating the `ControlRigLayerInstance` and adding the ControlRig as a new track.
As a result, when transitioning between shots containing several characters with faceboard ControlRig tracks, we observe a 20/30ms of work solely dedicated to ControlRig initialization. This makes shot transitions highly noticeable and can significantly affect the continuity of the sequence.
From our analysis, aside from saving PreAnimatedState data and registering the ControlRig onto the `ControlRigLayerInstance`, there does not appear to be any substantial processing performed on the initialized rig between these two initialization passes.
Our questions are:
- Is this double initialization expected and required for correctness, are we overlooking an important dependency?
- If it is not strictly required, would it be safe to modify or patch the Sequencer template/system implementation to avoid the second initialization?
Any guidance would be greatly appreciated.
Thank you.
Thomas VALLENTIN
[Attachment Removed]