Forum Replies Created

Page 18 of 277
  • Filip Vandueren

    February 21, 2023 at 10:50 am in reply to: change text over time with expression

    Depends on what you mean by “gradual” change.

    Do you want the layers to fade ? Flip ? Just suddenly change with a cut, one by one ?

    And for example, what would there be at the 50% mark in your example ?

    Should the expression be smart enough that “text” is present in both start and finish, even though those characters are at different locations in the text-string ?

    It’s a non-trivial problem to solve, but I think you have to define the design first.

  • oh Btw:

    Some fonts have different widths for their regular space, so sometimes you will want to replace the spaces with a different unicode spacer that’s closer.

    Here’s a list of possible characters, not all of them work (the cursor would then go to 0,0 everytime inencounters a space) so I’d stick to the range \u2004 – \u2009

    https://www.compart.com/en/unicode/category/Zs

  • hi Paul,

    the Point Control can be omitted, the expression there could have been added directly to he position of the Null. But in that case all of the implied/omitted thisLayer.s of the expression’s properties need to be spelled out as a property of the textLyaer, and I found it more convenient to have the “leading edge position” of the text to be a property on the text layer itself.

    When applied directly to the Null, it would become:

    txtL = thisComp.layer("txt");

    i = txtL.text.animator("Animate On (opacity)").selector("Range Selector 1").start.value;

    // length of sourcetext excluding linebreaks and softbreaks;

    l = txtL.text.sourceText.replace(/\n|\r|\3/g,"").length;

    if (txtL.text.animator("Animate On (opacity)").selector("Range Selector 1").advanced.units.value==1) {

    // convert from percentage to index

    i = i*l/100;

    }

    i=Math.round(i);

    if (i==l) i--; // never exceed the last character !

    sr = txtL.sourceRectAtTime(-100-i);

    txtL.toComp([sr.left, sr.top+sr.height/2]);

    But I’d keep it on the textLayer personally.

    Conceivably, you could even have the cursor jump from the end of 1 completed text-layer to the start of the next by adding some code in the Null to interpolate between different pointControls on different textlayers.

    But you’re very correct in noting that a point control on a text layer (as on all continuosly rasterized layers) is always in Comp space.

  • Filip Vandueren

    February 17, 2023 at 4:17 pm in reply to: Dynamically Distribute Text Layers Horizontally

    Are they all single line texts ? Are the differences in ascenders and descenders from layer to layer the problem ?

  • 1.content() doesn’t make sense, perhaps you’re looking for this:

    thisProperty.propertyGroup(4)(thisProperty.propertyGroup(3).propertyIndex-1).content(1).position-[250,0];

    There’s an extra invisible PropertyGroup Parent up the chain: each ShapeGroup has an extra .contents level, so we need to go up 4 groups to get to the Base “Contents” and there you want to target the previous Rectangle by index, so: “my Rectangle Groups property index -1”

    (and my Group is 3 levels up, again counting an invisible “.contents” layer)

  • Filip Vandueren

    February 17, 2023 at 12:34 pm in reply to: Filling space between animated paths

    I’ve never in 20 years used it but: the effect Generate -> Paint Bucket can do this, if you don’t mind that the fill isn’t vectorial but a pixeleffect.

  • Filip Vandueren

    February 17, 2023 at 12:26 pm in reply to: Сount the number of words in a text

    If you mean, count the number of lines broken off by hard and soft returns:

    txt = thisComp.layer("txt").text.sourceText;
    txt.split(/\r\n?|\n|\3/g).length

    If you need the number of lines that are being wrapped in a paragraph box, not by eneterd linebreaks: that’s harder.
    If all the paragraph-space-before and -after margins are at 0, and if the leading and fontsize is consistent across the whole text, and if all the lines are visible, and if you don’t care about empty lines at start or finish… (yes that’s a lot ifs) then it can (usually) be calculated by:

    txt = thisComp.layer("txt").text.sourceText;
    ld = txt.style.autoLeading ? txt.style.fontSize*1.2 : txt.style.leading;
    Math.round(thisComp.layer("txt").sourceRectAtTime().height/(ld));

    But this can break with fonts like Zapfino that may have extravagant Swashes that are much much larger than the font’s x-height.

  • Hi Paul, something like this:

    https://imgur.com/a/SkZuL2D

    It’s based on subSourceRect, and more or less uses the position of the last visible letter in a Null, the cursor is then parented to thenull so it can have its own relative keyframes (at start and end)

    The motion of the Null is controlled automatically by the opacity text-animator.

    There’s a lot of different moving parts and little expressions that don’ make a lot of sense on their own to control text-animators, so posting the code will be just confusing, but here’s the projectfile:

    https://we.tl/t-t4LRGmHPgf

    View post on imgur.com

  • Is this to dynamically position a custom cursor for a type in effect? Can you elaborate a bit on what the result needs to be ?

    Is it only on 1 line text, or can it be multi line paragraph text too?

  • Filip Vandueren

    February 15, 2023 at 2:34 pm in reply to: Animate two directions

    Ok, sounds like you can take the difference between the large one and the smallest one, and multiply that by 1/4 , 2/4 , 3/4. If the large one (which never moves) is not at zero, then those fractions of the distance the smallest one moves, you should add to that base-position.

Page 18 of 277

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