# how to extend this animation to infinity?

So I have this kind of animation:

It changes the location of an object in steps:

on frame 24, it is 0
on frame 25 it becomes 4
on frame 49 it 4
on frame 50 it becomes 8


unfortunately my knowledge in nla/using cycles modifier or any other modifiers in graph editor is very limited.

So my question is: how can I extend that animation without manually copying the keyframes and moving them?

*** UPDATE ***

Although I answered my own question here if would still give the "right" check to somebody who can also present me a solution for solving this without a driver; and shows me a way with nla/graph editor because I am sure I need this for more complex animations where I don't have an easy formula, but a repeating steps of an animation which just "adds" it values.

Maybe the Stepped Interpolation f-Curve modifier is the one you're looking for?

.. although you have to do the arithmetic a bit backwards, from your POV ..(start-value, end-value, frame-length of step).

Or.. if you want the cycle to go on for ever, this might be your way..

Set one step as keyframes, with T > 'Constant' interpolation, and then set a Cycles modifier as shown above.

Note: As Gordon mentioned it is important to check which channel is selected. If you don't select explicitly one channel Blender will take the "default" channel which is x, if you don't select another one.

• +1 yes, for my case this works, but what if there would be a more complex animation, like e.g. some zigzag values? how can i repeat that? So what i am looking for is an animation which i define for let's say 20 frames and i want to add the values the next 20 frames and so on. So kind of cyclic, but additive Nov 25 '21 at 10:24
• so are there 2 keyframes, is this right? Nov 25 '21 at 10:39
• Right, but in the comments above you were asking if this works for more complex animations, it does: pasteall.org/pic/b2f3d1bf56a54f69b18cf0bbe2be83e3 as you can see here. If you don't use any restricted frame range and leave the count at 0, the "Repeat with Offset" mode basically repeats infinitely all keyframes that exist on the curve, with continuing by using the last keyframe as start for the next cycle. Nov 25 '21 at 10:43
• @Chris The Before Mode and After Mode settings are "Repeat with Offset". You leave it at the default "Repeat Motion". But even then it would repeat, just differently. Are you sure you've selected the correct curve? Because if you did it should be shown thicker than the others. //EDIT: Just did exactly what you did, when you don't explicitly choose a curve the modifier is added to the first by default, which is X. But the movement is on Y. Nov 25 '21 at 11:02
• @GordonBrinkmann: Thank you man!!! That was it!!!! Nov 25 '21 at 11:04

ok, after i bit of thinking...driver is the solution:

i just added a driver for my x value like this:

floor((frame)/25) * my_value