Skip to main content
May 5, 2015
Answered

Ticking Clock

  • May 5, 2015
  • 2 replies
  • 4801 views

We have all seen the old clock rotation expression where you create a rotation for the second hand and then tie the minute hand to the rotation with an expression so that it moves at 1/60th the speed to simulate minutes and seconds right?

I am trying to create something similar but with a 'ticking' clock like a timex watch on the second hand so that it ticks along. tick, tick, tick, tick instead of the smooth rotation. I have worked that out using this expression tied to rotation:

var tick = time*6;

Math.floor(tick)

But what I want to happen is now to have the minute hand ( separate layer ) tick over 6 degrees every minute. In other words, it holds for 59 seconds and then jumps 6 degrees in 1 second.

I can't figure that part out. Any ideas?

Thanks

Jim

This topic has been closed for replies.
Correct answer Dan Ebberts

I'd do it this way:

// second hand

Math.floor(time)*6

// minute hand

Math.floor(time/60)*6

Dan

2 replies

Mathias Moehl
Community Expert
Community Expert
May 8, 2015

Instead of a Math.floor you can also use the "Snap to Grid" iExpression.

snap_to_grid.png

This requires that you have iExpressions installed on your system, but has the advantage that you can also smoothly transition from one tick to the next instead of having an abrupt jump. See this tutorial for further details:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Community Expert
May 8, 2015

In this thread, Dan also describes yet another way to create the smooth transitions from one tick to the next:

Watch, clicking effect?

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
May 5, 2015

I'd do it this way:

// second hand

Math.floor(time)*6

// minute hand

Math.floor(time/60)*6

Dan

May 5, 2015

Dan, you are a genius… I was trying to figure out something by tying the minute hand to the second hand with an expression, and then doing an if / or > 360 and it just wasn’t working.

if ( thisComp.layer("Second Hand").transform.rotation < 360){

0

} else {

Math.round(thisComp.layer("Second Hand").transform.rotation)

}

Can you expand on how your elegant solution works? The math floor keeps it at 0 until it hits time / 60 and then multiply by 6? It works perfectly, I just don’t quite understand how.

By the way, I bought myself the Animation Monkey Suite back in Dec as a gift to myself and I haven’t had a chance to crack it open yet. I am excited to dig into some projects with that software.

Jim

Dan Ebberts
Community Expert
Community Expert
May 5, 2015

Math.floor(time/60) just rounds the time down to the nearest minute. The *6 gives you the 6 degrees per minute.

Dan