ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Can I use timeToCurrentFormat to have an expression start at an exact time?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aza Allen
Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 9, 2011 at 12:36:25 am

I have a large, lengthy composition and I want to use expressions in some parts. I want to fire an expression at an exact time, but can't quite seem to find out how to do it... I've searched, but most posts on the subject are really specific to a person's needs, or don't quite match.

The "time" input in an expression calculates in seconds from the beginning of the comp, correct? My comp (and subsequent precomps) are over an hour long, so calculating the number of seconds I'm currently at is unwieldy, especially if I want to get Frame specific.

So, back to my question, can I use timeToCurrentFormat to somehow trigger an expression from the CTI?

If not, is there another way? I didn't get specific about my exact needs because I am hoping there is a general way to be able to do this that I can plug in to various circumstances...

Thanks all!
Aza

Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com


Return to posts index

Greg Burrus
Re: Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 9, 2011 at 10:21:52 pm

I'm not an expression guru but when I have used that timeToCurrentFormat(I usally do frames) I triggered event based on If statements. So once it gets to X frame it triggers what I want to happen. This is probably a basic way to do it but that usually works for what I need.

Another way you could trigger expression is using the expression timeline script, http://aescripts.com/expression-timeline/. I use this all the time when I have more complicated expressions or just want a nice gui, and I only want an expression to happen at between a range.


hope this helps

Greg

http://mogra.g2bproductions.com/ - Blog
http://g2bproductions.com/ - Portfolio


Return to posts index

Dan Ebberts
Re: Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 11, 2011 at 12:18:45 am

I Don't think timeToCurrentFormat() gets you anywhere. It seems like maybe what you need to do is specify your start time as hr:min:sec:frames
and then parse that in the expression to convert it to seconds. Then use variable "t" in your expression instead of "time". Like this example:


tStart = "01:33:25:19"; // your start time

tSplit = tStart.split(":");

tSec = parseInt(tSplit[0],10)*3600;
tSec += parseInt(tSplit[1],10)*60;
tSec += parseInt(tSplit[2],10);
tSec += parseInt(tSplit[3],10)*thisComp.frameDuration;

t = time - tSec;
if (t > 0){

// your expression goes here using "t" instead of "time"

}else{
value
}




Dan



Return to posts index


Dan Ebberts
Re: Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 11, 2011 at 2:49:20 am

Hmmm.... the more I think about it, the more I think you were on the right track. Something like this should work (assuming that your current format uses colons as separators):


tStart = "00:00:07:12";
if (timeToCurrentFormat() > tStart)
100
else
0


Dan



Return to posts index

Aza Allen
Re: Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 11, 2011 at 6:47:25 am

Thanks Dan, I will give it a try! I don't know how you get anything else done when you are answering our noob questions all the time ;)

BTW - Where is "time" measured from in an expression, the beginning of the Comp, or the layer?

Thanks again!

Aza

Make sure to check out our website http://www.makeyourfriendsuncomfortable.com and my personal website http://www.ruesterprod.com


Return to posts index

Dan Ebberts
Re: Can I use timeToCurrentFormat to have an expression start at an exact time?
on Jul 11, 2011 at 3:05:23 pm

time is comp time.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]