Unraveling the toComp Expression in After Effects

Mathias Möhl Demystifies the After Effects toComp and fromComp functions With Practical Examples.

There is no doubt that there are some functions with After Effects expressions that can confuse motion design artists. One of them is the toComp and fromComp functions. Luckily Mamoworld’s Mathias Möhl can demystify those two functions pretty quickly. “Watch this 1-minute tutorial to understand how they work and how to use them,” Möhl says.

The tutorial covers the concepts using an example where Mathias links the center of a circle effect on one layer to the center of a circle on a second layer. Using expressions, they will always stay in place no matter how you move, scale or parent any of the two layers. Check out the expression used in the tutorial below:

 

var posInOrangeLayerSpace = thisComp.layer(“orange solid”).effect(“Circle”)(“Center”);
var posInCompSpace = thisComp.layer(“orange solid”).toComp(posInOrangeLayerSpace);
var posInGreenLayerSpace = thisLayer.fromComp(posInCompSpace);
posInGreenLayerSpace