> For the complete documentation index, see [llms.txt](https://tk233.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk233.gitbook.io/notes/3d-modeling/repeat-an-animation-with-offset-in-blender.md).

# Repeat an Animation with Offset in Blender

Many game animation asset motions comes with looped animations. Typically they provide separate file s for the start of animation, end of animation, and a repeatable loop body of the animation.

In this note, we will see how to extend and repeat this animation indefinitely in blender.

### Example File

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FyPrGFSit1RGSvBnPdd1q%2Fimage.png?alt=media&amp;token=7acd1fa1-6812-4432-a804-18eb5fc311b3" alt=""><figcaption></figcaption></figure>

Here, we will use this d01-prone-f-loop.fbx as a demonstration.

Import this animation FBX in blender

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2Fo3uFOn2mdtjuRZqzlj9B%2Fimage.png?alt=media&amp;token=a3f1622f-ed0e-4928-a82c-7966d02a0040" alt=""><figcaption></figcaption></figure>

Select the armature, go to the "Animation" panel, and set the window view as "Graph Editor".

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FnFHRQlWpeQI5I00eHM7O%2Fimage.png?alt=media&amp;token=baf1c444-653b-4c21-b5f9-d65ea97c862a" alt=""><figcaption></figcaption></figure>

In this view, it plots all the keyframe values on the timeline

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FMkXEdipE03dliahHXA4u%2Fimage.png?alt=media&amp;token=1d68603d-a929-4f70-85af-a5e83e596348" alt=""><figcaption></figcaption></figure>

To repeat the motion, select all the keypoints by pressing `A`, and then press `Shift` + `E`. In the opened menu, select "Make Cyclic (F-Modifier)".&#x20;

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FUgXmUhJozbqUrvSvaPre%2Fimage.png?alt=media&amp;token=c3224031-1dec-497d-9498-17a4611902f0" alt=""><figcaption></figcaption></figure>

For more information on the F-Modifier, please see [here](https://docs.blender.org/manual/en/latest/editors/graph_editor/fcurves/modifiers.html#cycles).

Now the values are repeating, but we also want to offset the global root positions to let the character keep climb forward.

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FkO6o4EKrZjykhOPBkpEM%2Fimage.png?alt=media&amp;token=9f428ffe-b315-49a9-9750-7f61e77467ad" alt=""><figcaption></figcaption></figure>

To do this, select a datapoint from the keyframe entry that we want to modify:

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FLLHBrIwfpqyNEfg1KAKT%2Fimage.png?alt=media&amp;token=f54e5368-66c3-4fd2-91ca-afb80305340c" alt=""><figcaption></figcaption></figure>

Go to the right N-menu of this window, select "Modifiers" panel, and set both the Before Mode and After Mode to be "Repeat with Offset".

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FRx2qKSwJf8K72wcqfknC%2Fimage.png?alt=media&amp;token=cf22b091-a595-4c45-91d0-801f9859b1a1" alt=""><figcaption></figcaption></figure>

Now we can see that the green Y-axis value keeps increasing / decreasing indefinintely.

<figure><img src="https://1287130752-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvVJ0h2a4qMIhB1I8GdV8%2Fuploads%2FTAOtkiGHsQr0SuMYUHKP%2Fimage.png?alt=media&amp;token=20feb895-0cb8-4c1b-abc8-2ce7f0a91aea" alt=""><figcaption></figcaption></figure>

Final note: this modifier is compatible with our Python API that reads the pose bone values, hence can be used in the PoseLib-V2 reference motion generation pipeline.

## References

{% embed url="<https://blender.stackexchange.com/questions/440/how-may-i-create-a-continuously-looping-animation>" %}

{% embed url="<https://blender.stackexchange.com/questions/132912/repeated-animation>" %}
