Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Ticking Clock

Guest
May 05, 2015 May 05, 2015

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

TOPICS
Expressions
4.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 05, 2015 May 05, 2015

I'd do it this way:

// second hand

Math.floor(time)*6

// minute hand

Math.floor(time/60)*6

Dan

Translate
Community Expert ,
May 05, 2015 May 05, 2015

I'd do it this way:

// second hand

Math.floor(time)*6

// minute hand

Math.floor(time/60)*6

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2015 May 05, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2015 May 05, 2015

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

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 05, 2015 May 05, 2015

Ah... Got it.

Math.floor // rounds down

(time // in seconds

/60 // equals 1 minute

*6 // jumps 1 degree per minute.

Thanks, I am creating a tutorial online for this and will be sure and give you due credit on the solution. BTW, if you have any sort of Affiliate Sales agreement set up with your products, shoot me an email and we can talk privately about that if you like.

Jim

help@motiongraphicsacademy.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2015 May 08, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2015 May 08, 2015
LATEST

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines