Photoshop files can contain layer sets, groups of layers that are imported into AE as precomps. Unfortunately these precomps are always the same size as the main comp. This script crops the precomps to the size of their contents, while retaining their correct position in the main comp. Ideally the script should be run on a freshly imported PSD comp before any changes are made.
I wrote this script based on a request from Mark Coleran
http://www.coleran.com, a leading screen graphics designer. Mark creates user interface designs in Photoshop made up of many layer sets for the different UI components. This script makes it easier to manipulate the precomp layers, the bounding boxes accurately reflect the size/position of the precomps and effects are applied to a smaller area, making for more efficient renders.
Download pt_CropLayerSets_v1.2.zipHow to use:
Import a Photoshop file that contains layers sets, as a composition. Ensure you select layer bounds for layer size, and not document size. Select the composition in the project window and run the script