This script will figure out the "four corners and center point" of all kinds of 2D layers. Then create shapes, masks, nulls, etc. Supports multiple layers.
* Since this script is optical processed, the part with zero opacity (for example, the part outside the composition, null, etc.) is excluded from the processing.
After Effects Script