Forum Replies Created

Page 15 of 65
  • I know this is not what you were looking for, but you can try and merge your font with fonts from the countries it is missing. There is a free family from google named Noto, where you can get any language. However, if you your texts are mixed with RTL languages(like Arabic, Hebrew) After Effects will not handle that well.

    Here is an example of how to merge two or multiple fonts: Merging two fonts – Super User

  • Some observations:

    1. The words layer, height, leading are reserved, you can’t name variables or constants like that. You can notice they are yellow in the expression editor.

    2. Layers in AE are split by \r not by \n

    3. You can call layer functions in the layer without saying layer at start.

    4. The size of the first row is not always your font size (I noticed you used fontSize/2). Most of the fonts are a little smaller than the actual font size. Some (like the noto family from google, the versions for arabic for example) are bigger than the actual font size. I suggest using a variable and adjusting it. You should only re-adjust it if you change the font size.

    I think this should work.

    Adjust the diff constant for your case. Start with half the font size and go up or down from there (only if necesarry).

    const diff = 100;
    const numLines = text.sourceText.value.split('\r').length;
    const myStyle = text.sourceText.style;
    const myFontSize = myStyle.fontSize;
    const myLeading = myStyle.autoLeading ? myFontSize * 1.2 : myStyle.leading;
    const myHeight = myLeading * (numLines - 1)-diff;
    [0, myHeight/2]

  • Andrei Popa

    September 3, 2021 at 3:15 pm in reply to: Parsing JSON Files – Fastest possible way?

    I tried to respond to you yesterday but for some reason it was considered spam and I couldn’t.

    The simplest way I can put it is this:

    toSource() is equivalent to JSON.stringify(). Except that it adds two parentheses, one at the start and one at the end. Better yet than JSON.stringify, toSource() can also serialize functions contained in your objects. The result is a string.

    eval() works like JSON.parse(). I used it several times with json files and it worked well. Way faster than JSON.parse(). Also, eval() is capable of evaluation objects that contain functions. The parameter sent to eval() must be a string.


    some basic example:

    var a = {some complicated object};

    var aString = a.toSource();


    You can save aString in some file.

    if you want to use var a again:

    var a = eval(aString);

    I didn’t find a lot against these 2 functions, except that you should not use eval() because it could cause harm by evaluating something someone else could pass to it. But I think it is safe if you use it in AE scripts.


  • Andrei Popa

    September 2, 2021 at 8:56 am in reply to: Parsing JSON Files – Fastest possible way?

    I remember I ran some tests for json creation and parsing with json2. In the end it looked like creating file with .toSource() and evaluating it with eval() was ages faster. And I think that if you do not have functions in your variable, the result from .toSource() can be used as json syntax.

  • Andrei Popa

    August 21, 2021 at 5:08 pm in reply to: Keyframes in scipts question

    Hi Damien. I tested this and I notice that you can only set the speed if you have any keyframe on that side. If this keyframe is the first, you can’t set in speed. If it is the last, you can’t set out speed.

  • Andrei Popa

    August 17, 2021 at 11:50 am in reply to: Link shape to another one linked to a text

    I think you can add this expression to the position of your rectangle:

    s = content("Rectangle 1").content("Rectangle Path 1").size;

    [s[0]/2,-s[1]/2]

    You can take the first variable by pick-whiping the size property of the rectangle. Mind that this is not the layer position, but the one of the rectangle. Now if you make your rectangle bigger/smaller, the bottom left position will be the same.

  • Andrei Popa

    August 6, 2021 at 5:44 pm in reply to: Scrolling text more than 300 words

    Can you post a short video? When does the text disappear? Is it still present in the timeline at the time when it disappears?

  • Andrei Popa

    August 4, 2021 at 7:11 am in reply to: adding a js library to a jsx script?

    If it’s one file only, you can add it by

    #include library.js

    or

    //@include library.js

    The second way avoids the errors from the linters.

    Note that the library should be in the same folder as the script.

  • Here is a link with redefinery scripts. You can access them from redefinery.com once the website is online again. I hope this is ok with moderators since I don’t want to achieve any advantage from them and the main free source is offline.

    https://www.dropbox.com/sh/ini40qoimbs7aaf/AAAcuR4mwFU15JIVKwXJFjBra?dl=0

  • Andrei Popa

    July 9, 2021 at 12:00 pm in reply to: Add random value at random intervals (ranges)

    If the expression applied to the Source Text works, you can use sourceRectAtTime(outPoint,false). Or whatever value you want, in seconds. Something like sourceRectAtTime(10,false) gives the size of the rectangle at second 10. So you can take the value from after the whole text is written.

Page 15 of 65

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