My Animator is configured to execute in FixedUpdate instead of Update. I am using it to pose a physics powered ragdoll. Looking through the code for RigBuilder I saw this:
void Update()
{
if (!graph.IsValid())
return;
syncSceneToStreamLayer.Update(m_RuntimeRigLayers);
for (int i = 0, count = m_RuntimeRigLayers.Length; i < count; ++i)
{
if (m_RuntimeRigLayers[i].IsValid() && m_RuntimeRigLayers[i].active)
m_RuntimeRigLayers[i].Update();
}
}
There is nothing similar for FixedUpdate. Does AnimationRigging work with FixedUpdate?
I am coming to the conclusion that it is not possible to step the RigBuilder manually. Hopefully somebody will contractict me. I haven’t seen the source code for Playables that Animation Rigging is based on, but it looks like it is a DOTs/ECS system. I believe the “System” is hard-wired in Unity to run when the Animator runs (either in between Update and LateUpdate, or after FixedUpdate). There is no way to hook into this system and stepping the Animator manually (by disabling and calling animator.Update) doesn’t trigger the PlayableGraph.Evaluate.
I have run into the issue that the playables code executes off the main thread so it is not possible to query legacy unity objects like Transforms, PhysX RigidBodies etc… from inside the RigConstrinats code.
For these reasons I have started implementing a clone of AnimationRigging that runs on the Main Thread.