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

Iterate through all text layers, read a specific selector and create certain keyframes based on the selector ones.

New Here ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

Hi,

I have about ~50 text layers, on each of them I got a text selector named "Anim" with some keyframes specially positioned.

What I need is to read those keyframes of each Anim selector and add a new effect(lets say, glow for instance) to each of the text layers using some(not all) of the Anim keyframes, and set values on each of them(since we're using glow, could be threshold for instance).

I can handle the calculations, what I just need are the syntax for reaching those keyframes and setting values to them.

Thanks in advance.

TOPICS
Expressions

Views

2.6K

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

Community Expert , Aug 02, 2009 Aug 02, 2009

To get the value of a keyframe you just use the keyValue() method like this:

select.property("End").keyValue(i);

where i is the key index.

Dan

Votes

Translate

Translate
New Here ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

So far, I have this:

{
    app.beginUndoGroup("OMG");
    var actiItem = app.project.activeItem;

    if (actiItem == null || !(actiItem instanceof CompItem)) {
        alert("No active comp");
    }
    else {
        var layertotal = actiItem.numLayers;
        alert(layertotal + " layers being modified");

        for (aux = 1; aux <= layertotal; aux++) {
            var layeraux = actiItem.layer(aux);


            if (layeraux.isNull != true) {
                var select = layeraux.property("Text").property("Animators").property("Anim").property("Selectors").property("Anim selector");

                for (i = 0; i <= 100; ++i) {
                    select.property("End").setValueAtTime(i,i);
                }

The last part in red isnt supposed to be like that, I just tried to make sure I could set keyframes.

Now I only need a way to read keyframes from a given layer->property, any ideas?

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
Community Expert ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

To get the value of a keyframe you just use the keyValue() method like this:

select.property("End").keyValue(i);

where i is the key index.

Dan

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
New Here ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

Oh, thank you very much, that's exactly what I needed.

I didn't really try it, but I suppose the total keyframes is given by .numKeys?

And.. that returns me the value, is there a way to get the time which this keyframe is set?


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
Community Expert ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

> I didn't really try it, but I suppose the total keyframes is given by .numKeys?

Yes.

>is there a way to get the time which this keyframe is set?

.keyTime(index)

Dan

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
New Here ,
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

LATEST

Thanks!

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