ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to deal with keyframes that don't lie on a full frame

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
ole sturm
Expression to deal with keyframes that don't lie on a full frame
on Sep 10, 2018 at 10:37:30 am

Hi everyone,

I'm working on a a lip-sync project in which I'm linking the jaw's animation to another comp which contains data for the mouth.

I'm using AEScript's lipsyncr 2 script to analyse audio and generate a comp that matches mouth positions to the audio via Time Remap.

In my jaw comp I'm linking position states of the jaw to the time remap in the above comp. So far so good. However, the expression I'm using isn't working, returning only "0" or "10" but when I manually add keyframes everything works fine.

It seems to have something to do with the fact that Lipsyncr creates keyframes that don't always lie on a full frame so I'm wondering whether there's a work-around for this?

Here's the expression I'm using:

lipsync=effect("Linked")("Slider")
if (lipsync == 0.0) {
0
}else if (lipsync == 0.1) {
30
}else if (lipsync == 0.2) {
15
}else {
10
}


If the above isn't quite clear, here's a reduced copy of the project (approx. 1Mb): https://www.dropbox.com/sh/isu6r59o3ctci95/AAA-abFuyGK-foegFCVPFT70a?dl=0

Thanks very much for any help.


Return to posts index

Dan Ebberts
Re: Expression to deal with keyframes that don't lie on a full frame
on Sep 10, 2018 at 4:23:18 pm

Try this instead:


lipsync=Math.round(effect("Linked")("Slider")*10);

if (lipsync == 0) {
0
}else if (lipsync == 1) {
30
}else if (lipsync == 2) {
15
}else {
10
}



Dan



Return to posts index

ole sturm
Re: Expression to deal with keyframes that don't lie on a full frame
on Sep 10, 2018 at 7:17:29 pm

Thank you so much Dan. I know many of the questions that come up here must seem trivial to you but to many of us out here your expressions-related help is invaluable - I personally have been at the taking end of your help since at least 2004. If you've got a "buy me a beer" button stashed away anywhere, please let me know. Failing that, let me know when you're in Berlin and I'll make sure your beer and bratwurst needs are covered.


Return to posts index

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