UPDATED Automated analogue clock display preset

Scripting for After Effects

UPDATED Automated analogue clock display preset

Postby lowmankind on 08/10/2008, 10:53 pm

Hey All

Threw this together in the spirit of experimentation and thought it may be useful. It's a group of presets for automating a display of an analogue clock; simply apply the presets, set the time in hours, minutes and seconds, and the animation is taken care of for you.

(scroll down for latest version)

MAKE SURE YOU READ THE INSTRUCTIONS in the zip archive. The workflow for applying these presets does require some specific things to take place, including how you name the layers. A project file is included so you can get to grips with it.

NOTE: Presets and Project file are for AE7+
Last edited by lowmankind on 08/13/2008, 4:40 pm, edited 2 times in total.
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: Automated analogue clock display preset

Postby tequilaman2006 on 08/10/2008, 11:07 pm

ill try it! thanks!
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: Automated analogue clock display preset

Postby codemonkey123 on 08/12/2008, 5:06 am

Nice work sir!!
codemonkey123
VC Moderator
VC Moderator
 
Posts: 1877
Joined: 08/5/2008, 12:57 am

Re: Automated analogue clock display preset

Postby lowmankind on 08/12/2008, 7:21 pm

Slightly updated to include a "Time Multiplier" slider control. This control is used for changing the speed at which the clock works. So for example, if you want the clock to spin at double-time, set this value to 2. If you want the clock to move at half speed, set the value to 0.5. This controller is, of course, keyframeable for ramping the speed of your clock.

Clock_Preset_1.1.zip
Updated v1.1 with new Time Multiplier
(14.22 KiB) Downloaded 2563 times


Enjoy!
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/12/2008, 8:16 pm

as if 1.0 wasnt cool enough! :P

dont take this as criticism, in fact, it is just a suggestion.

if you plan on updating again, you should look into an expression to make the position only update every second, so the second hand essentially "jumps" to the next position every second (like the old school analogue clocks used to)

i have seen an expression like this around, and i dont remember where. maybe posta new topic to ask about it even,.... but for now i have to take a crap. :P

thanks again!
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby lowmankind on 08/12/2008, 11:12 pm

tequilaman2006 wrote:if you plan on updating again, you should look into an expression to make the position only update every second, so the second hand essentially "jumps" to the next position every second (like the old school analogue clocks used to)

i have seen an expression like this around, and i dont remember where.

yeah, that was one of the thoughts I've had regarding this preset... I know that doing so isn't terribly hard, although the exact method escapes me right now... but I've got too much work atm and can only play around with experiments when I have the time to do so
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/12/2008, 11:16 pm

sounds good. i might play with it and post.... :] with your permission of course.

i would personally apply the expression to a checkbox control, to make it an option for users to have the streamline effect or the ticking effect.

like i said ill play with it, got nothin better to do atm. lol.
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/13/2008, 12:40 am

i dont know where to find the expression i was talkng about... and so i tried to reconstruct. unfortunately, i failed. :P

(working at 30 FPS)
Code: Select all
val = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);

if ((val%30) == 0) {
effect("Seconds")("Slider")*6+(time*6)
}else{
value}


this does the job... sorta. when the time is at one second, the second hand jumps as expected to the one second mark. but, as soon as frame 31 comes around, the hand jumps back to 0.... which i forgot about. lol.

its a cool jittery effect, but still a failure. if i can find the real expression, i will. or someone can correct me in a hurry! lol.
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/13/2008, 3:32 am

ok well 3 hrs later and really late at night, ive had this clock working flawlessly for ages now. but i got myself caught up in amking a "digital" clock to follow it.

i have the digital clock working flawlessly until 1 hr, 9 min, and 59 sec. (1:09:59)

then, it goes to 1:010:00-1:010:09, and the next second results in absolute failure and the total number of seconds (4210)

well i know the issue, but its so late!

ill post the project sometime tomorrow IF ANYONE REQUESTS IT. :P

peace!
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby lowmankind on 08/13/2008, 5:49 am

I'd be happy to have a play with your Digital Clock preset... I'm not super awesome at expressions, I just make presets to speed up workflows mostly, so it's generally more about effects than it is about using expressions... that being said, VCP opened my eyes to how great expressions are, so I've been slowly implementing them into my work, although of course it's usually wiggle(x,y)...

ahem

speeking of the clock thing, Aharon Rabinowitz at Creative Cow made something similar... it was for an odometer, but the theory should be exactly the same... I can't remember which part of the tutorial is the most relevant here, but in part 3 he shows an expression to make the numbers 'pop' to the next in the sequence... that expression in general is absolutely insane, and he doesnt' even bother to explain it, since he got a friend (an expert on expressions) to work it out for him:

Part 1 - http://library.creativecow.net/articles/rabinowitz_aharon/Odometer_1.php
Part 2 - http://library.creativecow.net/articles/rabinowitz_aharon/Odometer_2.php
Part 3 - http://library.creativecow.net/articles/rabinowitz_aharon/Odometer_3.php
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/13/2008, 11:29 am

i normally wouldnt post until i watched the video, but since you mentioned not knowin a whole lot about expressions, check out this thread i posted on a lil while ago... there are a bunch of links in there that are bound to be helpful--a few months ago i knew nothing about expressions either!!

(btw, the best of them might just be http://www.maltaannon.com/ . there are lots of video tutorials for free. the other sites are mostly text-based, but definitely worth checking out!!

viewtopic.php?f=5&t=1155

(maltaannon and graymachine are two people with great sites! http://www.graymachine.com/ (i heard his site was down currently, just wait i guess.)
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/16/2008, 6:41 pm

okay. after a very long break, i have this digital clock figured out. mind you this is a large expression, but it is needed to make the clock look right in any situation (tested through 24 hours to work seamlessly!!)

please read the "Read Me.txt" for isntructions.

Enjoy!! and please give me feedback! this is my first preset creation, and im pretty proud of it.
Attachments
DigiClock v. 1.0.zip
My first preset for creating both an analogue and a digital clock that work together seamlessly!
(31.33 KiB) Downloaded 4076 times
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby lowmankind on 08/17/2008, 2:39 am

Good stuff, tequilaman... I'll check that out when I'm at work, although I don't know if I can play with it too much (will try) as I have a deadline in a week and I've not got nearly enough work done on it... so I'll post my comments when I get the opportunity...

I did find a bit of spare time to develop a new set of presets... I won't give the game away just yet, but it's got something to do with, um, dirt and damage... the reason I'm holding back is because I'm thinking that they're so good that I may try to e-market them a little... you know, sell them for $1 each via paypal or sell it as a bundle for a bit more (something like that)... of course, since I have such gratitude to VCP, I'll release a free version available only through this site for a limited time... but I have a few ideas to iron out yet, and a few more to kick around, so they'll be ready when they're ready :)
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: UPDATED Automated analogue clock display preset

Postby Karla on 08/17/2008, 6:06 am

Hey is there any chance making one for us 6.5 users? :oops:
Karla
 
Posts: 1
Joined: 08/7/2008, 12:50 pm

Re: UPDATED Automated analogue clock display preset

Postby lowmankind on 08/17/2008, 6:58 am

Karla wrote:Hey is there any chance making one for us 6.5 users? :oops:

that shouldn't be anything of a problem... but I do need to ask for you to be patient as I have to seriously work like crazy over the next week... if I find some spare time, I'll do it for ya, so watch this space :)
lowmankind
 
Posts: 63
Joined: 08/1/2008, 7:54 pm
Location: Australia
Twitter: tomhauville

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/17/2008, 5:56 pm

Karla wrote:Hey is there any chance making one for us 6.5 users? :oops:

haha well i dont have 6.5, or i would love to.

if you wanna use JUST the digital clock part, here is the simplified expression to make it display the real time of the comp: (apply to the Source Text of any text layer, named whatever you want)
(PS dont mind its hugeness, this is necessary to make it work through 24:00:00 :ugeek: )
Code: Select all
addedSec = thisComp.layer("Controller").effect("Seconds")("Slider");
addedMin = thisComp.layer("Controller").effect("Minutes")("Slider")*60;
addedHr = thisComp.layer("Controller").effect("Hours")("Slider")*3600;
addedTime = addedSec + addedMin + addedHr;


sec = Math.floor(time + addedTime) * thisComp.layer("Controller").effect("Time Multiplier")("Slider");
minvar = Math.floor(sec/60);
hrvar = Math.floor(sec/3600);
sechrvar = Math.floor(sec - (3600*hrvar));
minhrvar = Math.floor(sechrvar/60);

if(sec<0){
"Err: Negative Time"
}else{

if ((sec - 10) < 0) {
":0" + sec

} else {

if ((sec - 60) < 0) {
":" + sec

}else{

if (((sec/60)>1) && ((sec - minvar*60)<10) && (sec<3600)) {
(minvar) + ":0" + (sec - minvar*60)

}else{

if ((sec - 60) < 0) {
":" + sec

}else{

if ((sec/60) == 1) {
(minvar) + ":00"

}else{

if (((sec/60)>1) && ((sec - minvar*60)>=10) && (sec<3600)) {
(minvar) + ":" + (sec - minvar*60)
}else{

if((sec - 3600*hrvar) == 0){
(hrvar) + ":00:00"
}else{

if(((sec - 3600) > 0) && ((sec - (3600*hrvar) - (minhrvar*60)< 10)) && (minhrvar<10)){
(hrvar) + ":0" +  minhrvar + ":0" + (sechrvar - minhrvar*60)
}else{

if(((sec - 3600) > 0) && ((sec - (3600*hrvar) - (minhrvar*60)) >=10) && (minhrvar < 10)){
(hrvar) + ":0" + minhrvar + ":" + (sechrvar - minhrvar*60)
}else{

if(((sec - 3600) > 0) && ((sec - (3600*hrvar) - (minhrvar*60)) < 10) && (minhrvar >= 10)){
(hrvar) + ":" + minhrvar + ":0" + (sechrvar - minhrvar*60)
}else{


if(((sec - 3600) > 0) && ((sec - (3600*hrvar) - (minhrvar*60)) >=10) && (minhrvar >= 10)){
(hrvar) + ":" + minhrvar + ":" + (sechrvar - minhrvar*60)
}else{

sec}}}}}}}}}}}}


i added a little bit of stuff at the top (the variables called "addedSec" "addedMin "addedHr" "addedTime"). delete this stuff if you dont need to adjust the time. also you must delete everything after
Code: Select all
sec = Math.floor(time + addedTime)
in the 5th line. (trust me, it would be easier to just leave these, and follow the instructions below...)

if you do, however, need to adjust the time, you must make sliders named "Hours", "Minutes" ,"Seconds" and "Time Multiplier" applied to a Null Object called "Controller" BEFORE applying this expression to the text layer's source text.

Then, just add the # of Hrs, Min and Sec you want by adjusting the sliders! Make the Time Multiplier to "2" to double the speed of the clock.

This is only for the digital display, not the Analogue display... sorry. for those 6.5 users, make the null and make your own preset, since I dont have 6.5.

good luck, and be sure to show me your videos if you doend up using this, id love to see it used.
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/17/2008, 5:58 pm

oh btw i think in 6.5 math is different... like instead of just "a-b" you have to say "sub(a,b)"

if this is true, sorry. i dont feel like editing the whole thing, but you can. :P
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/25/2008, 1:11 am

has anyone played around with the clock?? i know its "old news" but i was proud of it and would love comments... :P
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby rickson on 08/31/2008, 6:34 am

at the bottom of this link, there is a video that says time machine...can i do the effect at 1 min 30 sec with this digi clock?

http://www.aurora-visual.jp/
rickson
 
Posts: 13
Joined: 08/30/2008, 8:34 am

Re: UPDATED Automated analogue clock display preset

Postby tequilaman2006 on 08/31/2008, 7:39 pm

I couldn't access the video you mentioned, but with this clock, you can set the time to any time you wish. simply use the slider controls on the "Controller" null to change the starting time, and then it will continue on from there.
"Is it the right of the postal service to search every package to see if I'm sending you a photocopied novel? if its not right in the analog world, it isn't right in the digital world either."

--a very smart person.
tequilaman2006
 
Posts: 163
Joined: 08/2/2008, 11:54 pm
Location: the mindless downloads of america

Re: UPDATED Automated analogue clock display preset

Postby GrAnD on 09/6/2008, 5:23 pm

rickson wrote:at the bottom of this link, there is a video that says time machine...can i do the effect at 1 min 30 sec with this digi clock?

http://www.aurora-visual.jp/


It's already been discussed here: viewtopic.php?f=4&t=2512&p=14974&hilit=counter#p14974

I even provided an expression how to do it.
GrAnD
 
Posts: 270
Joined: 08/2/2008, 2:10 pm

Re: UPDATED Automated analogue clock display preset

Postby lrntbb2 on 10/5/2016, 1:33 am

lrntbb2
 
Posts: 4
Joined: 06/3/2016, 2:58 am
System Specs: i7
32 gigs
gtx 770


Return to After Effects Expressions