Is there a similar script around which will take any comp and crop it to the boundary of the visible layers?
This script won't crop the currently active comp, just the precomps inside it. If you place your comp in another comp and run the script from there, it will crop it, but it assumes all layers are unchanged (100% scale and 0 degree rotation) as they would be in a newly imported PSD.
There is a "sourceRectAtTime()" scripting method (page 48 of AE CS3 scripting guide.pdf) but I think it may only work for text and shape layers. And there have been a few threads about trying to calculating the bounds of text layers:http://www.aenhancers.com/viewtopic.php?f=8&t=150http://www.aenhancers.com/viewtopic.php?f=6&t=931
I've been getting a lot of these lately:
"Unable to execute script at line 75. After Effects error: Unable to set "width". value -2616 out of range 1 to 30000."
Is it possible to make the script also ignore layers that are outside of the canvas?
Those errors were caused by having layers that were outside the canvas. I've changed it to ignore those layers. Let me know if it works ok.
Download pt_CropLayerSets_v1.2.zip (link removed)