-
Interpolate Between Multiple Values (making a face controller)
Hey guys — I could really use some help with this.
I’m trying to make a “face” rig where the face can look left/right/up/down.
Thus far I’ve been using valueAtTime linked to 2 sliders — 1 “LEFT/RIGHT” slider and 1 “UP/DOWN” slider.
I then animate a left-to-right movement using shape layers’ root level transforms, with frame 0 being “left” and frame 20 being “right” and write valueAtTime expressions on those transforms linking them to the LEFT RIGHT slider. (When I move the LEFT RIGHT slider from 0 to 20, the head “turns” from left to right)
I then animate up-to-down movement using the shape layers’s SHAPE GROUP transforms (since I’ve already written expressions on the root level transforms), with 0 being “up” and 20 being “down”, then write valueAtTime expressions on these props linking them to the UP/DOWN slider. (When I move the UP DOWN slider from 0 to 20, the head “turns” from up to down).
I then use linear expressions to link the sliders to a NULL that is positioned over the face, linking LEFT RIGHT to the null’s X position, and UP DOWN to the null’s Y position.
This way I can move the null, and the face “moves” based on the animations I created.
So far so good.
What I’m trying to do is do all of these animations on ONE transform group (not 2) by interpolating between the 4 values of LEFT, RIGHT, UP and DOWN. This way I basically just have to “set” a LEFT pose, a “RIGHT” pose, an “UP” pose, and a “DOWN” pose, and then the expressions will take care of the rest.
Is there any way to interpolate between 4 values like this. I imagine it involves using an “ease” expression that eases between 2 other ease expressions, but I can’t figure it out.
How do you interpolate between 4 values?
See the expression below where I’m trying to interpolate between 4 different position values (at 0 frames, 10f, 20f, 30f)
// SLIDERS
var lr = thisComp.layer("CONTROL").effect("L/R")("Slider");
var ud = thisComp.layer("CONTROL").effect("U/D")("Slider");// EXPRESSIONS
var f = thisComp.frameDuration;
var left = valueAtTime(0)
var right = valueAtTime(10*f)
var up = valueAtTime(20*f)
var down = valueAtTime(30*f)// EASE BETWEEN THE VALUES USING THE SLIDERS
var lre = ease(lr,0,20,left,right)
var ude = ease(ud,0,20,up,down)// ... NOW WHAT ...