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

let me re-phrase

New Here ,
Oct 15, 2011 Oct 15, 2011

Hello

I have a layer (footage) called Layer1

I want to duplicate it to Layer 2 (the name does matter)

I want to select Layer1 and apply a Preset called BG1

I want to select Layer2 and apply a Preset called Key1

How do I do that and is it even possible?

Rob

TOPICS
Scripting
1.2K
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 Expert ,
Oct 15, 2011 Oct 15, 2011

Something like this:

var myLayer1 = myComp.layer("Layer 1");

var myLayer2 = myLayer1.duplicate();

var myPreset1 = File(path to preset 1);

var myPreset2 = File(path to preset 2);

myLayer1.applyPreset(myPreset1);

myLayer2.applyPreset(myPreset2);

Dan

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 ,
Oct 15, 2011 Oct 15, 2011

Hello Dan

Many Thanks for your knowledgeable help

The only thing is, this script apply both thePreset1 and thePreset2 to theLayer1 only and not thePreset1 to theLayer1 and thePreset2 to theLayer2.

What I am doing wrong... And also I would like to duplicate from theSelectedLayers...

Much thanks

Rob

var myComp = app.project.activeItem;

var myLayer1 = myComp.selectedLayers[0];

var myLayer2 = myLayer1.duplicate();

var myPreset1 = File("/Applications/Adobe After Effects CS5/Presets/Bg.ffx");

var myPreset2 = File("/Applications/Adobe After Effects CS5/Presets/Key1.ffx");

myLayer1.applyPreset(myPreset1);

myLayer2.applyPreset(myPreset2);

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 Expert ,
Oct 15, 2011 Oct 15, 2011

Ah yes, I forgot about that little twist. After you apply the first preset, you probably need to do this:

myLayer1.selected = false;

myLayer2.selected = true;

Then apply the preset to Layer 2.

Dan

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 ,
Oct 15, 2011 Oct 15, 2011
LATEST

Dan

I truy thank you for bailing me out with this script. Your expertise and kindness in handling the forum is invaluable. I don't know what I would have done without your help. Thank you so much for your professional and effective help. I hope others will return the favor to you.

Rob

{

app.beginUndoGroup("DuplicateLayerAddPresets");

var myComp = app.project.activeItem;

var myLayer1 = myComp.selectedLayers[0];

var myLayer2 = myLayer1.duplicate();

var myPreset1 = File("/Applications/Adobe After Effects CS5/Presets/Bg.ffx");

var myPreset2 = File("/Applications/Adobe After Effects CS5/Presets/Key1.ffx");

myLayer1.applyPreset(myPreset1);

myLayer1.selected = false;

myLayer2.selected = true;

myLayer2.applyPreset(myPreset2);

app.endUndoGroup();

}

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