-
Use expression to ‘tween’ Shape object (path).
Hi Creative Cow
Thanks for taking the time to help me. I’m developing a lip-sync system in After Effects and I’m trying to set a specific mouth shape to occur at specific times determined by another Null Object. Basically this Null Object (called Mouth_Control) has a slider for each desired Mouth shape with a value between 1 an 0. 1 Being ‘on’ and 0 being ‘off’. There are 10 sliders.
I have then created a shape value which I would like to blend from shape to shape at the appropriate times. for example:
if (at frame 10 Mouth_Control.SliderAI = 1){this path = valueAtTime.AI Shape}
Obviously that isn’t the exact code. But hopefully it’ll give you an idea what I am doing.
Everything works perfectly. Except I can’t get the mouth shapes to blend (or tween) into each other. I can only allow it to snap from one shape to the next instead of letting it gently merge from one shape into another the way it does when you set keyframes and move the verticies in the shape by hand.
For example:
At Frame 9 the shape is the AI Mouth shape, (where AI on the null slider=1)
At Frame 12 the shape is the E Mouth shape, (where AI on the null slider=0 & E on the null slider=1)
However on frame 10 I would like the shape to be 33% AI and 66% E
On frame 11 I would like the shape to be 66% AI and 33% E
before finally becoming 100% E on Frame 12.I don’t know if this is even possible. I tried multiplying the shape by the NULL Object Value. At the end of the day, my ignorance of which expressions can be used on shapes is what is holding me back. I have placed the code below, any help would be greatly appreciated.
// variables determine the location of each mouth shape slider.AI = comp("NateRig").layer("Mouth_Control").effect("AI")("Slider") ;
E = comp("NateRig").layer("Mouth_Control").effect("E")("Slider") ;
etc = comp("NateRig").layer("Mouth_Control").effect("etc")("Slider") ;
FV = comp("NateRig").layer("Mouth_Control").effect("FV")("Slider") ;
L = comp("NateRig").layer("Mouth_Control").effect("L")("Slider") ;
MBP = comp("NateRig").layer("Mouth_Control").effect("MBP")("Slider") ;
O = comp("NateRig").layer("Mouth_Control").effect("O")("Slider") ;
rest = comp("NateRig").layer("Mouth_Control").effect("rest")("Slider") ;
U = comp("NateRig").layer("Mouth_Control").effect("U")("Slider") ;
WQ = comp("NateRig").layer("Mouth_Control").effect("WQ")("Slider") ;if(AI.valueAtTime(time)>0){value = valueAtTime(framesToTime(0))}
else if(E.valueAtTime(time)>0){value = valueAtTime(framesToTime(1))}
else if(etc.valueAtTime(time)>0){value = valueAtTime(framesToTime(2))}
else if(FV.valueAtTime(time)>0){value = valueAtTime(framesToTime(3))}
else if(L.valueAtTime(time)>0){value = valueAtTime(framesToTime(4))}
else if(MBP.valueAtTime(time)>0){value = valueAtTime(framesToTime(5))}
else if(O.valueAtTime(time)>0){value = valueAtTime(framesToTime(6))}
else if(rest.valueAtTime(time)>0){value = valueAtTime(framesToTime(7))}
else if(U.valueAtTime(time)>0){value = valueAtTime(framesToTime(8))}
else if(WQ.valueAtTime(time)>0){value = valueAtTime(framesToTime(9))}else{
value = valueAtTime(framesToTime(1))
}