Page 1 of 1

Clock hands

Posted: September 13th, 2006, 5:20 pm
by tarwin
Just put this code on some clock hands, initially pointing north (12 o'clock). You can change the start time with "forwardtime".

Hours

Code: Select all

forwardtime = 10;
starttime = time+(forwardtime*3600);
h =starttime/3600;
s = Math.floor(h);
s2 = h-s;
if (s2 > 0.99){
	transform.rotation = (Math.floor(h)*30)+((s2-0.99)*(1/0.01)*30);
}else{
	transform.rotation = Math.floor(h)*30;
}
Minutes

Code: Select all

forwardtime = 11;
starttime = time+(forwardtime*60);
m = starttime/60;
s = Math.floor(m);
s2 = m-s;
if (s2 > 0.9){
	transform.rotation = (Math.floor(m)*6)+((s2-0.9)*(1/0.1)*6);
}else{
	transform.rotation = Math.floor(m)*6;
}
Seconds

Code: Select all

timer = time+23;
s = Math.floor(timer);
s2 = timer-s;
if (s2 > 0.7){
	transform.rotation = (Math.floor(timer)*6)+((s2-0.7)*(1/0.3)*6);
}else{
	transform.rotation = Math.floor(timer)*6;
}

Transform?

Posted: November 28th, 2006, 12:35 pm
by mrblifil
What is the use of the "transform" property? Is that an After Effects 7 thing?

Posted: November 28th, 2006, 2:03 pm
by Dan Ebberts
Yes it is. You also get it with the pick whip and the default expression.

Dan

AF rejects expression

Posted: February 3rd, 2007, 11:37 am
by afaj
When trying to use any of these expression texts, I get the message:

"Expression result must be of dimension 2, not 1. Expression disabled."

Any ideas? Thanks.