How can I find the dimensions in pixels of a layer in adobe after effects.
To find the pixel dimensions of a layer you can use this expression:
layer.sourceRectAtTime(t = time, includeExtents = false)
t: the time index, in seconds. A floating-point value.
includeExtents: true to include the extents, false otherwise. Extents apply to shape layers only, increasing the size of the layer bounds as necessary.
This is only for AE version > 13.2 (CC 2014.2). See the announcement here.
For earlier versions this question is relevant, in the answers there is a link to an expression that achieves the same result, albeit a lot slower.
You get the scale of the layer in the Transform property menu as seen below. The scale is in relation to the comp width and height if its solid or adjustment layer, for imported footage its in relation to the source width and height. To get pixel values you just do a little math:
(Comp or Footage width|height/100)*Scale = pixel dimension of layer
When it comes to shape layer, the size of the shape is shown in the path menu unless its a custom shape, there is no easy built-in way to determine the bounding box of a custom path, you would need to write a script for that.