25% OFF Everything* with code CYBER during our Cyber Extravaganza! *Click for details

Trim Comp to Contents

  • Compatibility After Effects
    Please check exact version compatibility under the "COMPATIBILITY" tab below

Author: Zack Lovatt

Subscribe for notifications
Subscribe for new version notifications Subscribe
Name Your Own Price Individual users can pay any amount, the price displayed is a suggestion. Businesses, teams, etc must pay the suggested price to receive a valid license. See full terms.
Add to Wishlist

Quick Overview

Trim or extend comp duration to fit layer contents.

Trim Comp to Contents

More Views

Videos

This script trims or lengthens your current comp duration to the in & out points of its contents, without affecting layer timing relative to one another.

If you have layers extending past the beginning or end of your composition, the script will extend the comp to fit them as well.

By default, the script will trim to all layers in your comp (including locked layers), though there are options to change functionality.

 

Options:

  • Trim to All - Trim to all layers (if checked) or selected layers (if unchecked).
  • Ignore Locked Layers - Consider locked layers for trimming, or leave them out of the logic.
  • Crop Nested Comps - Whether to run through any nested comps (precomps) and trim those as well
  • Preserve Comp Start Time - If comp doesn't start at 0, should the script preserve the start point?

 

Headless Version

If you're not interested in using the UI panel version, you can use Trim Comp to Contents with your favourite script launcher (like ft-toolbar or Script Launcher). Simply point the launcher/toolbar to the script file, and will run without showing the UI.

Using the following modifier keys, you can alter functionality in a few ways.

  • Alt / Option – Use selected layers only (vs all)
  • Shift – Ignore locked layers
  • Ctrl / Cmd – Preserve comp start time

 

Originally requested by Alan Fregtman.

After Effects 2025, 2024, 2023, 2022, 2021, 2020, CC 2019, CC 2018, CC 2017, CC 2015.3, CC 2015, CC 2014, CC, CS6, CS5.5, CS5, CS4
View all Zack Lovatt products