user22495: I was wondering about a expression that sticks a layer position on to the top left corner of a square solid in After Effects, so that when the scale of the solid changes, the stuck position follows the corner around. Can someone help with this?

user1950: The position of any point on a layer in terms of its location in the composition frame is given by the layer space transform function toComp(). Since the top left of a layer is the origin in After Effects, from the point of view of the solid its top left is going to be [0, 0]. So we find the position of the point [0, 0] on the layer in terms of the comp thus:
thisComp.layer('<name of the solid>').toComp([0,0])

Apply that to the position property of the layer you want to stick to the solid.

22495: <p>I was wondering about a expression that sticks a layer position on to the top left corner of a square solid in After Effects, so that when the scale of the solid changes, the stuck position follows the corner around. Can someone help with this?</p>
 1950: <p>The position of any point on a layer in terms of its location in the composition frame is given by the layer space transform function <code>toComp()</code>. Since the top left of a layer is the origin in After Effects, from the point of view of the solid its top left is going to be [0, 0]. So we find the position of the point [0, 0] on the layer in terms of the comp thus:</p>

<pre><code>thisComp.layer('&lt;name of the solid&gt;').toComp([0,0])
</code></pre>

<p>Apply that to the position property of the layer you want to stick to the solid.</p>
