FORUMS: list search recent posts

Interpolate Between Multiple Values (making a face controller)

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rob Frese
Interpolate Between Multiple Values (making a face controller)
on Sep 18, 2015 at 5:53:19 pm

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)

var lr = thisComp.layer("CONTROL").effect("L/R")("Slider");
var ud = thisComp.layer("CONTROL").effect("U/D")("Slider");

var f = thisComp.frameDuration;
var left = valueAtTime(0)
var right = valueAtTime(10*f)
var up = valueAtTime(20*f)
var down = valueAtTime(30*f)

var lre = ease(lr,0,20,left,right)
var ude = ease(ud,0,20,up,down)

// ... NOW WHAT ...

Return to posts index

Kalle Kannisto
Re: Interpolate Between Multiple Values (making a face controller)
on Sep 21, 2015 at 6:09:21 pm

Let me first try and understand what you are doing: What is it that you are animating? Do you have a 20-frame animation of the head moving from left to right and another 20-frame animation of the head moving from up to down? If so, you won't get all the poses, you will just get either the up-and-down motion or side-to-side motion. You'll need 20 x 20 frames = 400 frames to cover all the head positions. Is this what you have?

Or do you have it set up in a different way? How?

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved