Forum Replies Created

Page 52 of 277
  • Filip Vandueren

    June 4, 2021 at 7:38 am in reply to: Zipper Effect

    Text on a Path is the easier way if you can find (or make) a font that has the right shape for you.

  • Filip Vandueren

    June 1, 2021 at 3:46 pm in reply to: One expression 2 sliders

    The website converted straight “quotes” to curly “quotes”.

    JavaScript needs straight single or double quotes.

  • Filip Vandueren

    June 1, 2021 at 3:19 pm in reply to: One expression 2 sliders

    Combine both values into the same style by chaining the methods:

    newStyle = style.setFontSize(effect(“Size”)(“Slider”)).setLeading(effect(“Leading”)(“Slider”));
  • Sometimes you can get away with doing the effects with the bezier warp effect, those parameters are all just 2D positions and can be easily adjusted with scripts and expressions.

  • The only thing you can do with expressions of custom properties is valueAtTime();

    The only thing you can do via scripting is apply Animation Presets, there’s no access to the actual values inside those properties.

  • Filip Vandueren

    May 31, 2021 at 12:41 pm in reply to: Count the number of glyphs in a text layer

    I thought something similar, but where can you find the list of characters that will form a ligature for a given font?

  • Can you first check that in your project settings the JavaScript Engine is set to “JavaScript” ? Legacy extendscript would fail on the reduce() method.

    Also if your after effects is not in English, name==“Checkbox” would be a bad check.

  • I think making an array of the checkboxes first is a good idea,
    maybe something along these lines:

    For opacity (hiding text-layers):

    controls = thisComp.layer("Null 1")("Effects");
    checks = [];
    for (i=1; i <=controls.numProperties; i++) {
    if (controls(i)(1).name=="Checkbox") checks.push(controls(i)(1).value);
    }
    firstTextLayerIndex=2;
    myIndex = index-firstTextLayerIndex;
    checks[myIndex]*100;

    For position (text-layers):

    controls = thisComp.layer("Null 1")("Effects");

    checks = [];

    for (i=1; i <= controls.numProperties; i++) {

    if (controls(i)(1).name=="Checkbox") checks.push(controls(i)(1).value);

    }

    numActive = checks.reduce((a,b) => a+b ,0);

    firstTextLayerIndex=2;

    myIndex = index-firstTextLayerIndex;

    linespacing = 980/numActive;

    top = 0;

    for(i=0; i < myIndex; i++) {

    if (checks[i]) top+=linespacing;

    }

    thisComp.layer(firstTextLayerIndex).position + [0,top];

    Of course this is assuming the texts are never breaking to be more than 1 line high, that would make it a bit more complex, looping through all the sourceRectAtTimes to calculate a better top-value.

  • Filip Vandueren

    May 28, 2021 at 11:20 am in reply to: Count the number of glyphs in a text layer

    There is no way for javascript to know. Javascript deals in strings, and lets the renderer decide how to display that (Ligatures or not, for example), So I think it’s the same as in the Browser: you can’t know.

    I don’t know if it totally breaks legibility but is disabling ligatures an option ?

  • This version is better if you experience glitches: (sometimes doing % and / operations on time gives glitchy results, it depends on the framerate. using timeToFrames() can fix that)

    seedRandom(index,true);

    moveDistance = 100;

    moveEvery = 25;

    startPos = [960,540];

    moves=[startPos];

    possibleMoves = [[1,0],[-1,0],[0,1],[0,-1]];

    st = thisLayer.startTime;

    // create all moves up front

    for (i=0; i<timeToFrames(thisComp.duration - st); i+=moveEvery) {

    move = possibleMoves[ Math.floor(random(4)) ];

    lastPos = moves[moves.length-1];

    newPos = lastPos + move*moveDistance;

    moves.push(newPos);

    }

    f=timeToFrames(time-st);

    t=f%moveEvery;

    step = Math.floor(f/moveEvery);

    ease( t, 0, moveEvery, moves[step], moves[step+1]);

Page 52 of 277

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