Remove unused solids from your project

All things .jsx

Moderator: Paul Tuersley

Post Reply
malex
Posts: 20
Joined: May 21st, 2004, 3:03 pm

This script will go through your project, find any item that is a solid, make sure it isn't used, and delete it.
It doesn't affect footage items.


{
// Go backwards through all the items in the project
// Go backwards because we'll be deleting items from the list.
for (i = app.project.numItems; i >= 1; i--) {

var cur_item = app.project.item(i);
if (cur_item.typeName == "Footage" &&
cur_item.mainSource instanceof SolidSource) {

// The item is a solid.
var comps_using_item = cur_item.usedIn;
if (comps_using_item.length == 0) {

// The Solid is not used in any comps. Remove it.
cur_item.remove();
}
}
}

}


-------

Project before the script :

Image

And after

Image
Post Reply