Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Can one put a group of layers into independant precomps?

Engaged ,
Jan 20, 2019 Jan 20, 2019

I have a crap-load of layers that each need to be in their own precomp. Is there any way, script or plug-in, that would allow me to select a group of layers from the time line and make it so each of those layers get into their own precomp?

8.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 22, 2019 Jan 22, 2019

Sorry, missed a line when I pasted:

var moveAllAttributes = true;
var laycol = app.project.activeItem.layers;


// first cache the array of layer selections, starting at the bottom
var selectedLayers = new Array();
for (var i=laycol.length; i>0; i--) {

    var thislayer = laycol;
    if (thislayer.selected) selectedLayers.push(i);
}


// now precompose them individually
for (var s=0; s<selectedLayers.length; s++) {
    var thislayer = laycol[selectedLayers];
    var precomp_name = thislayer.name;
    laycol.prec

...
Translate
Engaged ,
Mar 13, 2019 Mar 13, 2019

Thank you so much for this.

Sorry, after my wife went to the hospital things got very crazy. I havent been able to mess with this stuff at all. But things are slowin' down a bit, so I'm gonna be able to start tinkering with it again. Sorry for vanishing. Your help is deeply appreciated!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 11, 2021 Nov 11, 2021

For some reason, this isn't creating the precomps. I saved this code into a .jsx file and ran it, but nothing happens.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 10, 2022 Jan 10, 2022

Same here! I also tried running the script with KBar but nothing happens. This script would be super helpfull! Im thinking about reinstalling AE2019 to get this to work :'D

Let me know if you figure anythign out!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 07, 2022 Oct 07, 2022

Could you please explain how I can use this? I'm a noob. Thanks

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2023 Feb 24, 2023

Hi!
Where I should place this expression? Can't figure it out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 20, 2024 Nov 20, 2024

Where does one paste this script into?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 20, 2024 Nov 20, 2024
LATEST

You can use QuickScript extension to quickly run a script:

var proj = app.project;
var thisComp = proj.activeItem;
var selectedLayers = thisComp.selectedLayers;
app.beginUndoGroup("undo");
for (var i = 0; i < selectedLayers.length; i++) {
    thisComp.layers.precompose([selectedLayers[i].index], selectedLayers[i].name, true);
}
app.endUndoGroup();

MaxAppian.gifexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines