Copy link to clipboard
Copied
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
I'd do it this way:
// second hand
Math.floor(time)*6
// minute hand
Math.floor(time/60)*6
Dan
Copy link to clipboard
Copied
I'd do it this way:
// second hand
Math.floor(time)*6
// minute hand
Math.floor(time/60)*6
Dan
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Math.floor(time/60) just rounds the time down to the nearest minute. The *6 gives you the 6 degrees per minute.
Dan
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Instead of a Math.floor you can also use the "Snap to Grid" iExpression.
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:
Copy link to clipboard
Copied
In this thread, Dan also describes yet another way to create the smooth transitions from one tick to the next:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now