AE expression
- Started
- Last post
- 8 Responses
- felizfeliz
I've googled it, looked at tutorials etc, still can't get my head around it or get a tutorial to work...
Does anyone know an expression for the TimeReMap value that will switch from frame 0 to frame 1 of the precomp each time there's a layer marker(and for the duration of the layer marker) on the precomp layer?
cheers in advance...
- chossy0
Sounds very much like you have over complicated something which can be done with simple basic animation.
Perhaps you could describe it differently as I interpret this to mean something which is impossible to do.
- steven_segal0
Awww...I thought this was a thread making fun of account executives...
- felizfeliz0
So basically I have a walkcycle of a character, 8 frames repeating with a simple timeRemap expression across my comp.
I want the character to blink occasionally.
So I'm thinking it'd be nice to place a layer marker on the repeating walkcycle precomp that will trigger an expression to reach inside the walkcycle and switch the eyes precomp frame from 0 to 1. and to switch it back to frame 0 at the end of the layer marker duration.
I could easily do this in flash, simple by having a movie clip repeating, and on the main timeline putting something like this when I need it to close it's eyes:
walkcycle_mc.eye_mc.gotoAndStop...
and when it needs to open them a few frames
later:walkcycle_mc.eye_mc.gotoAn...
- chossy0
simply make the blink animation time it offset the timing so it is random then use the same repeating code on that.
- chossy0
I know you want it to be neat and tidy but fuck it you will get the same result.
- felizfeliz0
ah come on, it should be simple... no?
- akiersky0
so I would comp the eyes blinking, and parent that to the comp of the guy walking, so the eyes follow the position of the walk. then in your main comp you can write an expression to loop the guy walking. add the Time Remap to the walking guy then option/alt click on the stopwatch and enter this:
loopOut("cycle")then write another expression on the eyes that grabs a random number and if that number is above/below a threshold (number) tell that comp to play. so again add the Time Remap, option/alt click the stopwatch and enter this:
t=random(1,5)
if(t==1){
0
}
you may have to adjust the random max value to get the frequency of blinking for your guy because it will grab a random number each frame, so something like random(1,30) may give a better result.check out
http://www.motionscript.com/
or
http://www.graymachine.com/wp09/…
for some great tutorials on expressions.
- felizfeliz0
Thank you, works a treat.