Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Remove all shape layers in selected composition

  • Jim Scott

    July 21, 2017 at 6:06 pm

    I don’t know how to create a script, if that’s what you’re asking, but if you just want to remove all shape layers: Enter “shape” in the search window above the layers in the Timeline panel. Drag to select them all (don’t use “select all”)… delete. Clear the search window by clicking the X and the remaining layers will be displayed.

  • Arun Chaudhary

    July 22, 2017 at 4:55 am

    Thank you, Jim Scott, for your reply but this is not work in my case i have 500 hundred + comp. so I don,t want open all 1 by1 I want select all comp run script then removed all shapes layer in comp.

  • Walter Soyka

    July 23, 2017 at 11:50 am

    Here’s a quick script that will remove all shape layers in the selected comps in a project (or in the active comp if no selection is made).

    Back up your project file first and use this at your own risk!

    function deleteAllShapeLayersInComp(comp) {
    // delete all shape layers in the specifed comp

    // step through the comp, removing any shape layers as we go
    // work backwards from the last layer, because removing later layers won't affect the indices of earlier ones
    for(var i = comp.numLayers; i >= 1; i--) {
    if (comp.layers[i] instanceof ShapeLayer) comp.layers[i].remove();
    }
    }

    function processProjectSelectionComps(func) {
    // go through all selected items in a project. if they're comps, perform the specifed function on them

    if (app.project.selection.length > 0) {
    for (var i = 0; i < app.project.selection.length; i++) {
    if (app.project.selection[i] instanceof CompItem) {
    func(app.project.selection[i]);
    }
    }
    }
    }

    app.beginUndoGroup("Delete All Shape Layers");

    if (app.project.selection.length > 0) {
    processProjectSelectionComps(deleteAllShapeLayersInComp);
    } else if (app.project.activeItem instanceof CompItem) {
    deleteAllShapeLayersInComp(app.project.activeItem);
    }

    app.endUndoGroup();

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Arun Chaudhary

    July 26, 2017 at 6:10 am

    Hi, Walter Soyka
    I want to say you are legends you make my day you script work fine as I want
    Thank you so much

  • Arun Chaudhary

    September 14, 2017 at 1:26 pm

    Hi,
    again I need your help I find a post for Remove all files in a shape layer, John Colombo script works fine for active comp. but I want this script works for selected comp. in a project
    and add a stroke in all shape layer stroke width can be set. if it is possible
    https://forums.creativecow.net/thread/227/30520
    I am very grateful to you
    Arun

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy