How can I sample an animation rigging frame in editor/game?

I have a rigged character that is animated with an AnimationClip. I want to be able to sample specific frames from this clip and apply them to the model. I want to use that to create static characters, like dead bodies and statues.

I can sample the clip by writing “clip.SampleAnimation(modelGameObject, sampleTime)”, but it only samples the rig values, it does not actually apply the rig to the model. How can I apply the rig constraints after sampling the clip?

We have this feature built in in Animation Rigging. You can have a look at the following:

https://docs.unity3d.com/Packages/com.unity.animation.rigging@1.1/manual/BidirectionalMotionTransfer.html

and our GDC talk that covers it as well:

You can use “Transfer motion to skeleton” to bake your animation clip without your constraints, and then with a bit of cleanup, you can isolate poses if that’s what you wish to do.