Forum Replies Created

Page 160 of 1081
  • Dan Ebberts

    January 13, 2020 at 5:20 pm in reply to: how to connect letters to composition

    So if your text is in a text layer named “Text” in a comp named “Main” and your letter stacks are layers named “A”, “B”, “C”, etc in comps named “Letter_0”, “Letter_1”, etc., then you would apply an opacity expression like this to each letter layer:


    myIdx = parseInt(thisComp.name.split("_")[1],10);
    txt = comp("Main").layer("Text").text.sourceText.value;
    if (myIdx < txt.length){
    txt[myIdx] == name ? 100 : 0;
    }else
    0

    Dan

  • Dan Ebberts

    January 12, 2020 at 10:46 pm in reply to: timeToFrames() expression will not work. AE CC 2020

    You have to give it a result when the frame number isn’t divisible by 3, like this:


    if ((timeToFrames() % 3) == 0) {
    100*random(1)
    }else
    value

  • Dan Ebberts

    January 10, 2020 at 10:54 pm in reply to: Syncing text to audio

    Sorry, I don’t notice you had the expression applied to a range selector. I assumed the text was coming from the markers, so that expression is for the Source Text property.

    Dan

  • Dan Ebberts

    January 10, 2020 at 8:02 pm in reply to: Syncing text to audio

    It looks like maybe you took several unrelated expressions and mooshed them together somehow. In any case, this should give you one basic way to sync the text to the markers:


    m = thisComp.layer("1.mp3").marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time){
    n--;
    }
    }
    if (n == 0){
    ""
    }else{
    m.key(n).comment;
    }

    Dan

  • Try applying this to the opacity property of each of your shape layers:

    totalFade = 5;
    minFade = .25;
    maxFade = 1;
    seedRandom(index,true);
    myFade = random(minFade,maxFade);
    myStart = random(0,totalFade-myFade);
    ease(time,myStart,myStart+myFade,0,100)

    Dan

  • Let’s say you have something controlled by a slider on a null. That might look like this:

    thisComp.layer(“controls”).effect(“Slider Control”)(“Slider”);

    If instead, you wanted to use a number in a text layer, you could do it like this:

    parseFloat(thisComp.layer(“text”).text.sourceText);

    Is that what you mean?

    Dan

  • That depends on what you mean by global. When I want something to be accessible from anywhere within my script, I declare an object just inside my enclosing function, like this:


    function de_NewScript(){

    // globals

    var G = new Object();
    G.scriptName = "Dan's New Script";\

    // functions

    function myUtilityFunction(){
    // function code here
    }

    // main code

    }
    de_NewScript();

    But if I need something global that two scripts can use to communicate, I would generally attach it to the app (maybe not recommended, but it seems to work):

    app.de_object = {};
    app.de_object.script1Present = true;

    Dan

  • You need to make sure that only one of those statements gets executed at any given frame. Something like this (not tested):


    if (time < key(5).time){
    linear(time, key(3).time, key(4).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"));
    }else if (time < key(7).time){
    linear(time, key(5).time, key(6).time, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"), value);
    }else if (time < key(9).time){
    linear(time, key(7).time, key(8).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));
    }else{
    linear(time, key(9).time, key(10).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));
    }

    Dan

  • An easy way to keep from cluttering AE’s namespace with your function names is to make sure everything in enclosed in a single function with a unique name, like this:


    function AndiraiMaji_01(){

    // your script here

    }
    AndiraiMaji_01();

    Dan

  • Ah, ok. In the three places where you have lines like this:

    var textProp = app.project.item(i).layer(“myTextLayer1”).property(“Source Text”);

    change the layer name to j, like this:

    var textProp = app.project.item(i).layer(j).property(“Source Text”);

    When you access a layer by name, you’ll always the the first layer with that name.

    Dan

Page 160 of 1081

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