Forum Replies Created

Page 32 of 65
  • Andrei Popa

    April 14, 2020 at 8:48 am in reply to: Write-On Text Expression

    It’s doable. Mostly the way you said it. Make all the letters individual comps in your project. Then make some dummy comps that link to the letters. These dummy comps would have expression to link to different letter, according to the input text.

    And not a very beast expression if you limit yourself to 20-40 characters. This is basically what i have done with my PPro version of my scripts(since there was no PPro scripting when I released them).

    You will have to save the bounds of the letters . And kerning, if your font requires to. Most of the handwritten fonts I came across don’t use kerning, or if they do, it’s almost negligible.

    I still think you will spend quite some time collecting the font data and designing the animations, but if you plan to use it a lot, I’d say it’s worth the effort.

    If you plan to out-source your work for a project like this, you can contact me at andrei@audaciousleap.com

    Andrei
    My Envato portfolio.

  • I don’t know about csv and tsv and i am reaaaaly busy now and can’t test. But here is a solution for JSON.

    Import your JSON file.

    add this expression to where you want to use it

    eval("var myVar = "+footage("data.json").sourceText)
    myVar["variable"]

    data.json is the name of the json file, case-sensitive.

    variable is the name of the particular variable/row/data you want to use, also case-sensitive

    You may also try this with csv and tsv, it may work. Also, check adobe’s page with dealing with data files : https://helpx.adobe.com/after-effects/using/data-driven-animations.html

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 9, 2020 at 8:24 pm in reply to: Write-On Text Expression

    You can’t do that. Not because you can’t find the pixels, but because you can’t tell AE what to do on crosses. Imagine having E. It does not know where to start, where to interrupt and where to start again.

    I have, for sale(see signature), several fonts automated by script to do this. Some also have a Premiere Pro version.

    Andrei
    My Envato portfolio.

  • You need 2 layers. You can’t set different font types for the same layer using expressions.

    Andrei
    My Envato portfolio.

  • Scripts are not faster than expression at execution.
    But an expression executes at each frame.
    The script only executes one time, when you ask it to.
    An expression equal in code with a script is like running that script for each frame.

    I didn’t know Math is slow.

    I know that it is very slow to link another property that links to another property and so on(recursively).
    Ex: if you put some layers one under the other, with some expression like thisComp.layer(index-1).position+[0,20], each time you add another layer, things complicate in an exponential manner. Because each layer calculates all the previous layers, since expressions don’t save the value. I don’t know if they optimized this in the latest versions(19-20), but this was a pain before.

    There are also the ones that calculate multiple values you had before in the composition, using valueAtTime() in some loops. The longer the composition, the more it takes for each frame to render.

    Turning to keyframes is a bit similar to scripts. When using “Convert Expression to Keyframes” you calculate the expressions, and then save the results. No more calculation when rendering.

    If anyone has more information, like what is super slow, of how can you measure the speed of your expressions, I would also love to hear.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 7, 2020 at 12:01 pm in reply to: valueAtTime is not a function

    ValueAtTime only apllies to properties. If you take the value of the slider and add 1, it is an integer. Not a property anymore.
    So if the slider is 2 at second 2 and 3 at second 3, you can ask what value it had at which second. But if you add something, let’s say at second 2, asking valueAtTime then is like asking what value does 3 have at another second. 3 is 3. Does not change value. That is why you must add it at the last line, where first you ask how big is the slider at given time and then add the number.

    If you really need the extra value to be taken into account in the w and not in the last line, you make 2 variables(w plus another one without the “+1”). And use the other one in the last line, then add one.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    April 6, 2020 at 5:06 pm in reply to: Changing time from seconds to frames in expression

    Change the declaration of duration variable. That first number is the number of frames.

    duration = 30 * thisComp.frameDuration;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 30, 2020 at 9:44 pm in reply to: Move keyframes in timeline using expressions

    I hope you have some knowledge about expressions because this will be a little bit hard to explain.

    I have some values, you will have to modify the expression to satisfty your needs.

    My csv has 2 columns: Times and Positions. First has some numbers, second has some 2 dimension arrays.
    I put my csv inside the timeline and pick-whip from the expression to “positions.csv>Data>Times 0″(layer, property, property) to see how the expression to link the first time would look like. Mine is thisComp.layer(“positions.csv”)(“Data”)(“Outline”)(“TImes”)(“TImes 0”).
    same for Positions, i get thisComp.layer(“positions.csv”)(“Data”)(“Outline”)(“Positions”)(“Positions 0”);. Considering these 2 paths, my expression looks like this:

    myData = thisComp.layer("positions.csv")("Data")("Outline");
    i=1;
    while(myData("Times")("Times "+i).value < time && i < myData("Times").numProperties-1) i++

    initTime = myData("Times")("Times " + (i-1)).value;
    endTime = myData("Times")("Times " + i).value;
    initPosition = eval(myData("Positions")("Positions "+(i-1)).value);
    endPosition = eval(myData("Positions")("Positions "+(i)).value);

    linear(time,initTime,endTime,initPosition,endPosition)

    I think that what you need to do is replace what comes after myData with what you have. Or make a 2 column table with the columns named Times and Positions as your csv.

    Andrei
    My Envato portfolio.

  • Try this
    values = [];
    for(i=0;i<=thisComp.layer("Data-Driven-Sample.csv")("Data")("Number of Rows")-1;i++) {
    rowVal = thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data " + i).value.toString();
    values.push(parseInt(rowVal.replace(",","")));
    }
    values.sort((a, b) => b - a);
    values.join("\n");

    // code on the corresponding item list to be sorted based on descending values of the above numbers list
    examples = [];
    for (i = 0;i <= thisComp.layer("Data-Driven-Sample.csv")("Data")("Number of Rows") - 1;i++) {

    var rowVal = {};
    rowVal.text = thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Text Data")("Text Data 0");
    rowVal.number = parseInt(thisComp.layer("Data-Driven-Sample.csv")("Data")("Outline")("Number Data")("Number Data "+i).value.toString().replace(",",""));
    examples.push(rowVal);

    }
    const list = examples.sort((a,b) => b.number-a.number).map((examples, number, array) => examples.text);
    list.join("\n");

    If this still doesn’t work, could you give me the csv so i can test the solution before posting?

    Andrei
    My Envato portfolio.

  • Maybe add .value at the end. Some of this small things changed with the expression engine.

    eval(thisComp.layer("Text Layer").text.sourceText.value)

    Andrei
    My Envato portfolio.

Page 32 of 65

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