-
Expression to deal with keyframes that don’t lie on a full frame
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.