Forum Replies Created

Page 33 of 65
  • Create a text layer. Put all this code in the text value. And on all your layers put this as expression:

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

    I think you’ll need to change the name of the layer. You can make it invisible so it does not mess with your design.

    Andrei
    My Envato portfolio.

  • I’ll guess you have to remove the comma and turn them into numbers for your sort to work. Also, making a for loop for the second makes it more elegant and also makes it work if you have more rows in your csv. Haven’t tried it, hope it works on the first run:

    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;
    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).replace(",",""));
    examples.push(rowVal);

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

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 28, 2020 at 8:10 pm in reply to: Camera Lens Blur – Blur Map Options

    I am also curious how that can be done. I enumerated the properties of Camera Lens Blur and they are these:

    Blur Radius
    Iris Properties
    Shape
    Roundness
    Aspect Ratio
    Rotation
    Diffraction Fringe
    Iris Properties
    Blur Map
    Layer
    Channel
    Placement
    Blur Focal Distance
    Invert Blur Map
    Blur Map
    Highlight
    Gain
    Threshold
    Saturation
    Highlight
    Edge Behavior
    Use Linear Working Space
    Compositing Options

    And the Layer must be a number. I tried setting it to a 2 sized array. Like 1 for first and 2 for second, but that did not work. I also tries setting it to mask property of another layer thinking that maybe After Effects would transform it into a correct value. That did not work either. Looks like that value does not exist for scripting.

    I’m all out of ideas for now.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 27, 2020 at 3:07 pm in reply to: link layer’s position to an existing slider

    It can be done but I need more information.

    1. Do you scale or resize it?(slider represents scale as percent or size in pixels)?\
    2. Where is the anchorPoint of this rectangle?

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 27, 2020 at 3:04 pm in reply to: Lock keyframes Position and Scale

    If someone knows how to unshy and unblock a layer, he should be safe changing a few keyframes.
    Plus, if he messes something up he may have auto-save, undo and such things at his diposal.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 27, 2020 at 12:44 pm in reply to: Lock keyframes Position and Scale

    You can precomp the lower third and then link the text values to 2 separate text layers that are in the mother composition. You can make these 2 layers guide layers, so they will not appear on render. And you can shy the precomp so someone does’nt enter it by error.

    Or you could block all the layers except the names, then make them shy, so they don’t appear in the timeline.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 27, 2020 at 1:17 am in reply to: Increment and add numbers in a text layer

    var str = thisComp.layer("Sample Layer").text.sourceText.match(/\d+/g);
    eval(str.join("+"))

    Andrei
    My Envato portfolio.

  • This will work with normal easing:


    masterLayer = hisComp.layer("top card");
    timeoffset = masterLayer.effect("Slider Control")("Slider");
    duration = masterLayer.rotation.key(2).time-masterLayer.rotation.key(1).time;
    idx = index-1;
    delay = timeoffset*idx;
    maxValue = 360-22.5*idx;
    ease(time,delay,delay+duration,0,maxValue);

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 26, 2020 at 8:40 am in reply to: Position text only inside area

    Here is how i would do this. Draw the rectangles from the first picture again. Then also draw the red one I made. After placing the text, add a function that does this:

    (is the layer inside red square?)
    yes =>DONE
    no=> (is the layer’s width smaller than one rectangle?)
    yes => check which rectangle is closer and place it entirely there by changing x position
    no=> reposition layer and rerun this function.

    To check which rectangle is closer, first check y position and see if its bottom or top. Then I think you can easily check which one is by considering the position and the justification of the text.

    Also, the project will run much faster if you do this with script at the creation point and not with a lot of expressions.

    Andrei
    My Envato portfolio.

  • I hope I understood you right. But this will only work on one-line texts. Or perfectly justified, because if the last line is shorter, the quote will be at the end of the entire paragraph.

    x=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).left +
    thisComp.layer("Bounding Box").transform.position[0] +
    thisComp.layer("Bounding Box").sourceRectAtTime().width + 16;
    y=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).top +
    thisComp.layer("Bounding Box").transform.position[1];
    B = [x,y];
    A = [960, 540];
    linear(thisLayer.effect("Slider Control")("Slider"), 0, 100, A, B);

    Andrei
    My Envato portfolio.

Page 33 of 65

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