2

So I have this kind of animation:

screenshot of F-curve showing step function

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.

Marty Fouts
  • 33,070
  • 10
  • 35
  • 79
Chris
  • 59,454
  • 6
  • 30
  • 84

2 Answers2

4

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

enter image description here

.. 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..

enter image description here

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.

Chris
  • 59,454
  • 6
  • 30
  • 84
Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • @Chris .. oops, missed the way which is closer to your OP.. see edit. – Robin Betts Nov 25 '21 at 10:24
  • 1
    +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 – Chris Nov 25 '21 at 10:24
  • @Chris I'm confident all the f-Curve modifiers can be assigned to actions, as well, in the NLA editor. I would have to make a little animation to illustrate.. unless you get there first ;) – Robin Betts Nov 25 '21 at 10:32
  • honestly...i am fighting to understand your second image...i don't get it... – Chris Nov 25 '21 at 10:33
  • @Chris What exactly are you fighting with, could you explain in detail? You add a Cycles modifier to the curve and set Before Mode and After Mode to "Repeat with Offset". That's all there is to see in the second image. – Gordon Brinkmann Nov 25 '21 at 10:36
  • @Chris 1 cycle is keyframed (z+4 in 25 frames). The keys' interpolation is set to 'Constant'. And then the f-Curve is given a Cycles modifier with settings as shown. Improve if you like. – Robin Betts Nov 25 '21 at 10:37
  • 1
    so are there 2 keyframes, is this right? – Chris Nov 25 '21 at 10:39
  • 1
    Right, but in the comments above you were asking if this works for more complex animations, it does: https://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. – Gordon Brinkmann Nov 25 '21 at 10:43
  • @Chris Right.Frame 0, Z=0, Frame 25, Z=4 – Robin Betts Nov 25 '21 at 10:44
  • 1
    @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. – Gordon Brinkmann Nov 25 '21 at 11:02
  • 1
    @GordonBrinkmann: Thank you man!!! That was it!!!! – Chris Nov 25 '21 at 11:04
  • @RobinBetts: I advanced your answer...so maybe other people who make the same mistake as me won't waste their time too....Thank you!! – Chris Nov 25 '21 at 11:07
  • @GordonBrinkmann: I wish i could give you more than just an upvote....but i could upvote some of your old answers.... ;) – Chris Nov 25 '21 at 11:08
  • @Chris Cheers! also, if you want to copy the cycles to other curves, rather than combining channels into an action, and modifiying the action in the NLA, check out this answer – Robin Betts Nov 25 '21 at 11:09
  • @Chris Cheers, but no need for that ;) – Gordon Brinkmann Nov 25 '21 at 11:16
2

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
Chris
  • 59,454
  • 6
  • 30
  • 84