ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Use position value to scale object

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rink Hof
Use position value to scale object
on Jul 6, 2017 at 12:01:04 pm
Last Edited By Rink Hof on Jul 7, 2017 at 12:12:53 pm

Hello there,

Im exploring AE face tracker, using Adobe tutorial as a guidance

All works fine but problems occur when the actor is moving his face towards the camera, because the tracker only tracks x, y values. The face tracker provide me left eye and right eye position values. Would it be possible to take the Left eye position and right eye position to scale the sunglasses when the actor moves his face towards the camera?

Below you'll find the expression I used to drive the rotation with the position values, taken from the Adobe tutorial.

So I assume I could use similar expression to scale my object, right?

// rotation
a = thisComp.layer("IMG_8116.MOV").effect("Face Track Points")("Mouth Left")
b =thisComp.layer("IMG_8116.MOV").effect("Face Track Points")("Mouth Right")
v = b-a;
radiansToDegrees(Math.atan2(v[1],v[0])) + transform.rotation

* Solved it with this expression! Tip from someone on this forum

// scale

a = thisComp.layer("Point A").position;
b = thisComp.layer("Point B").position;
d = length(a,b);
s =( d/width)*100;

Return to posts index

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