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?
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,v)) + transform.rotation
* Solved it with this expression! Tip from someone on this forum
a = thisComp.layer("Point A").position;
b = thisComp.layer("Point B").position;
d = length(a,b);
s =( d/width)*100;