5
$\begingroup$

Edit: To clarify, I want the second hand to "tick" every second and rotate 6 degrees instantaneously, not gradually. And I want that "tick" action to happen faster and faster.

I have a clock I'm making and I've got the second hand rotating using a cycle modifier; so every second it will rotate on an exponential curve by 6 degrees infinitely. This is all working fine and I'm happy with the result.

The tricky part is that I'm making it so the clock will tick faster and faster as part of an animation project I'm working on and I don't know how to get the Cycle modifier to behave that way.

I figure there must be some way to tell the cycle to do that, but I just can' figure it out.

Any advice?

$\endgroup$
3
  • 1
    $\begingroup$ Related: How to make non-linear movements with a Follow Path constraint? $\endgroup$
    – brockmann
    Commented Jun 18, 2021 at 7:16
  • $\begingroup$ As @brockmann suggests, you can use a Generator Modifier instead of a Cycle Modifier, with this you can enter a formula according to your needs and the Graph Editor will even give a visual result of the acceleration curve. $\endgroup$ Commented Jun 18, 2021 at 8:53
  • $\begingroup$ Thanks @GordonBrinkmann and Brockmann for the suggestion, but I might not have explained myself too well. My clock's second hand is ticking every second, which means it doesn't rotate gradually over time, but instead rotates 6 degrees instantly at the end of every second. I'm looking for that tick action to happen faster and faster over an infinite amount of time. $\endgroup$ Commented Jun 23, 2021 at 7:51

3 Answers 3

3
$\begingroup$

Okay, here is an idea now that you've explained a bit further. I have a clock, and the hand is moving 6° per second. I don't know how your setup is, mine is as follows:

My animation is set to 30 fps, so every 30 frames the hand jumps 6° in Z rotation, this is achieved by a driver. I'm subtracting 1 from the frame number so it starts at the 12 o'clock position.

Z = -floor( (frame-1)/30 ) / 6 * pi / 180

= -floor( (frame-1)/30 ) / 30 * pi

Multiplying by 6 is for the 6° jump and multiplying by pi / 180 is for calculating the radians. The minus is necessary to make the hand turn clockwise when looking at it top-down.

This makes the hand jump to the next 6° position each second. Now if you want the speed to accelerate over time you have introduce some exponential factor to achieve that.

To keep the formula simpler, I've added two custom properties to the hand object, the first one is called frames per second (the initial speed I want the hand to turn) and the other is called speed exponent. Those properties I add as new variables fps and exp in the driver.

Z = -floor( (pow(frame, exp) - 1) / fps ) / 30 * pi

I'd say you should use values between 1 and 2 for the exp variable first, because otherwise it would accelerate very quickly. Or set a higher fps value. Maybe this works for you, I guess there are a lot of possibilites to tweak the formula. Leaving exp at 1 would keep the ticking speed constant like in the first formula.

clock accelerating

$\endgroup$
6
  • $\begingroup$ Thanks for that, Gordon. I had a whack at it and the driver says that the Expression was invalid, and the Paths in the driver settings screen for both variables were highlighted red, which seems like it means they weren't working. I feel like I copied what is on your screen exactly, but I'll keep tinkering and see what comes up. Thanks! $\endgroup$ Commented Jul 12, 2021 at 1:28
  • $\begingroup$ @KristerCollin Hey Krister, hard to say without the file why it shows red. But sometimes it is shown as invalid when you haven't finished the driver edit and doesn't refresh, then it might help to click on Update Dependencies in the driver editor. $\endgroup$ Commented Jul 12, 2021 at 5:51
  • $\begingroup$ Gordon, thanks for the additional help. I realised what wasn't working and have gotten a step further, but now I find that no matter what I set the exponent to it isn't ever getting any faster over time. Looking at the Drivers Editor window shows no curve at all, just a straight line that's constant infinitely. Any clues? $\endgroup$ Commented Jul 15, 2021 at 10:39
  • $\begingroup$ @KristerCollin My driver editor window doesn't show a curve either, because it's not working like a mathematical graph, for example if I take an object, set Z = (frame/10)^2, than the graph shows the result for Z on the horizontal and vertical axis - of course that's a straight line, because Z = Z. But if you say it's not getting faster... do you have an exponential function? And if you check the rotation values at regular intervals, for example frame 50, 100, 150, 200 and so on, is the difference in rotation always the same for each step? $\endgroup$ Commented Jul 15, 2021 at 11:19
  • $\begingroup$ Thanks for all your help, Gordon, this did the trick. I had to import this for unreal, but I was able to bake keyframes and import it with ease. I also needed a bit more granular control over the increment speed to begin with, though, so I baked two versions out with different exponentials and it was just perfect. Late verifying your answer as correct because my computer died for the better part of a month, apologies. $\endgroup$ Commented Aug 27, 2021 at 10:56
5
$\begingroup$

Instead of a cycle modifier and animated keyframes you can try it with a driver.

e.g. just add a simple cube and add this into your x rotation value:

enter image description here

this will take the frame value, multiplies it with itself (thats why the speed of the rotation will accelerate) and divide it through 1000 so it won't be too fast. Of course you can adapt the formula to your needs.

With Right-Click on the rotation X you can "edit driver" and change your formula:

enter image description here

this example would slow down your acceleration a bit.

$\endgroup$
1
  • $\begingroup$ Thank you for the answer, Chris, but this isn't quite what I'm looking for. I realised I maybe didn't phrase my question as well as I could have. The second hand on my clock is ticking. It rotates 6 degrees instantaneously every second, not constantly every frame. What I'd like to happen is for the ticking to happen faster and faster. $\endgroup$ Commented Jun 23, 2021 at 7:47
3
$\begingroup$

This is possible through the UI, if you prefer.

  • Keyframe the rotation of the pointer over the desired range, at a constant speed.
  • Crack open a Graph editor, and select the rotation channel...

enter image description here

.. (you won't see some of these details, this frame was shot at the end of the process.) Give the track a 'Stepped Interpolation' modifier, adjust to taste. Now you have a pointer ticking round the dial.

  • Now, over to the NLA Editor. Your animation should automatically have been saved as an action. Now, 'Push' it down into the editor, as an NLA Strip...

enter image description here

In the 'Strip' tab, on the right, you will find an 'Animated Strip Time' checkbox. This allows you to remap the time in the strip, speediing it up or slowing it down as you wish. To begin with, set keyframes in there: 1 at frame 1, 360 at frame 360, or whatever your last frame is. This is a linear mapping, which shouldn't affect your animation.. it just puts a couple of keyframes in for manipulation.

Now back over to the Graph Editor:

enter image description here

... where you can pick up the 'Strip Time' curve. A straight line would be mapping the time to itself. Adjust the curve to be shallower at the start, steeper at the end. You can tweak the curve, until you get the effect you want.

enter image description here

$\endgroup$
5
  • $\begingroup$ @batFINGER Ooohh, sorry, Mr, FINGER.. I hate it when that happens, Trying to get my head round how you would vary speed in one strip via drivers, though? $\endgroup$
    – Robin Betts
    Commented Jun 23, 2021 at 19:31
  • $\begingroup$ I don't understand your comment on batfinger, but why shouldn't it be possible to vary speed in a driver? 🤔 I do it in my answer... or I don't get your point. $\endgroup$ Commented Jun 23, 2021 at 21:11
  • $\begingroup$ Hi @GordonBrinkmann sure you do.. Because of the original link batFINGER gave, I was thinking using drivers in the way he did there, scaling NLA strips uniformly. I couldn't see what you could drive inside the NLA that would vary the speed within a strip. I like your answer, and drivers do have the advantage that they could work over 'an infinite time' as Krister comments on her post. I haven't found the right cocktail of modifiers to do that $\endgroup$
    – Robin Betts
    Commented Jun 23, 2021 at 21:20
  • $\begingroup$ Ah okay, I didn't see the original link. What I don't like about my answer is that the formula very quickly produces very high values, there surely is room for tweaking. $\endgroup$ Commented Jun 23, 2021 at 21:43
  • $\begingroup$ @GordonBrinkmann well, if dx/dt is nx, that has to be exponential of one kind or another, I guess? If Krister is looking for a continuous acceleration over an indefinite time.. as always, hoping to be corrected.. I suppose dx/dt could be x+n.. $\endgroup$
    – Robin Betts
    Commented Jun 23, 2021 at 21:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .