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

Generate layers via expressions

Participant ,
Nov 26, 2016 Nov 26, 2016

Copy link to clipboard

Copied

Hi!

I'm looking into creating a shape layer based typeface that replaces a string of characters with shape layers all connected to a controller layer.

The ideal workflow would be:

1) write text in text layer

2) replace that text with shape layers

3) create a controller layer with individual settings for each letter

4) if a letter is duplicated in the controller layer then a new layer pops up in the timeline

I'm guessing this have to be done via scripting?

Does anyone have some starting points on how this can be achieved?

TOPICS
Expressions

Views

1.0K

Translate

Translate

Report

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 , Nov 27, 2016 Nov 27, 2016

Yes, it has to be done via scripting. Expressions cannot create stuff, only modify existing property streams. and even then your logic is flawed, since scripts do not respond to things like duplicating layers. Such stuff would have to be done in the script itself so it can set up the necessary linking.

Mylenium

Votes

Translate

Translate
LEGEND ,
Nov 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

Yes, it has to be done via scripting. Expressions cannot create stuff, only modify existing property streams. and even then your logic is flawed, since scripts do not respond to things like duplicating layers. Such stuff would have to be done in the script itself so it can set up the necessary linking.

Mylenium

Votes

Translate

Translate

Report

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
Participant ,
Nov 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

Thanks Mylenium!

If I'm understanding things correctly this CAN be done but would have to be self contained inside a script?

Do you have tips on a good introduction to scripting?

Votes

Translate

Translate

Report

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 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

One thing that might disappoint you is that point (4) in your ideal framework cannot be achieved as is.

After modifying the text layer's text, the user will have to click an "update" button somewhere in your script's UI, and the script will have to track back everything that the script has already created in the comp, and add the necessary extra stuff. In practice, it's feasable, but a bit cumbersome.

There are 3 main ressources for scripting (all are pdf):

for AE : the After Effects Scripting Guide

for the UI : the JavaScriptToolGuide and Peter Kahrel's ScriptUI for dummies.
The first 2 are from Adobe and should already be located in your Scripts folder. They are a bit dry though, and cruelly lack examples.

On the other hand, Peter Kahrel's pdf is full of axamples.

To get working examples of scripting code for after effects, have a look at Dan Ebbert's website: Table of Contents

For more, your best friend will be a web search engine.

Another thing to know is that some things are feasable via a script, but are not documented in any guide.

This is the case of your step 2 (menu commands are not documented).

The beginning of your script could look like this:

function create(){

    var comp = app.project.activeItem;

    if (comp===null || comp.typeName!=="Composition" || comp.selectedLayers.length!==1 || comp.selectedLayers[0].matchName!== "ADBE Text Layer"){alert("Please select one text layer"); return;};

    comp.openInViewer();

    app.executeCommand(app.findMenuCommandId("Create Shapes from Text"));

    // this will create a single shape layer with many groups, one for each letter

    // then you'll need to convert this single shape into individual shape layer, add controllers, etc

    };

function update(){

    alert("huhu");

    };

var win = new Window("palette", "test");

var createBTN = win.add("button", undefined, "create");

var updateBTN = win.add("button", undefined, "update");

createBTN.onClick = create;

updateBTN.onClick = update;

win.show();

Xavier

Votes

Translate

Translate

Report

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
Participant ,
Nov 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

LATEST

Much appreciated Xavier!

I'll look into everything and start a new thread when I have the ground work done.

Thanks again    

Votes

Translate

Translate

Report

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
LEGEND ,
Nov 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

I would recommend you start by reading the AE scripting guide and downloading scripts from sites like AEScripts, AEnhancers and so forth. Many (legacy) scripts are free and not encoded as .jsxbin, so you can learn a lot from them. Even the few scripts that are bundled up with AE can give you an idea of the basics. Other than that - yes, everything you do will have to be inside the script once you go down that road. AEScripts are modal (even panels) and do not track any activity of the outside world. In case of applying expressions it would be necessary to add code for checking whether expressions are already applied, who created them and so on. This can easily be achieved by adding comments to the code that your script recognizes. In any case, you should start by modifying an existing script and then expand upon that by adding your own routines. once you have a feel for how this works, things will be a lot easier.

Mylenium

Votes

Translate

Translate

Report

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
Participant ,
Nov 27, 2016 Nov 27, 2016

Copy link to clipboard

Copied

Thanks!

I will take a look at that!

Best

Martin

Votes

Translate

Translate

Report

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