Forum Replies Created

Page 44 of 65
  • Andrei Popa

    November 13, 2019 at 7:45 am in reply to: Using sourceRectAtTime(); to link two boxes together

    I would try to align the anchor of the shape layers to left. Try using this script i made for anchor point placement.

    Then add to the position the part of the sourceRectAtTime that you want. If you want one rectangle to be to the left of the other, then position should have something like this:

    prevPosition = thisComp.layer("Rectangle 1"). position;
    prevWidth = thisComp.layer("Rectangle 1").sourceRectAtTime(time,false).width;
    [prePosition[0]+prevWidth, value[1]]

    Similar to this, if you want them to be one under the other, you use the anchorPoint script. This is even easier. Set the anchorPoint to the top left for the bottom layer and bot left to the top layer. And let’s say you want the bottom layer to be aligned vertically and with a 20 px space under the top. Top being Rectangle 1, this is the position expression:

    prevPosition = thisComp.layer("Rectangle 1").position;
    padding = 20;
    [prevPosition[0]+padding, prevPosition[1]]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    November 5, 2019 at 7:16 am in reply to: Expression with user-defined comp

    I would create a text layer with the name of the comp I want to refer to.
    Then write the reference for the composition like this: comp(textLayer.text.sourceText.value)
    And put some conditions maybe, so if the composition with the value of the layer doesn’t exist, some default values come in.

    Andrei
    My Envato portfolio.

  • Give this a shot. Take into consideration that this does not work well with two consecutive empty comment markers.
    m = thisComp.layer("subtitles").marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if (n > 0){
    t = m.key(n).time;
    myComment = m.key(n).comment;
    (myComment != "") ? ease (time,t,t+0.2,0,100) : ease (time,t,t+0.2,100,0);
    }else
    0;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    November 2, 2019 at 7:26 am in reply to: Centering a dynamic square-expression-based text-layer

    This should be the expression of your anchorPoint
    var myWidth = sourceRectAtTime(time,false).width;
    var left = sourceRectAtTime(time,false).left;
    var myHeight = sourceRectAtTime(time,false).height;
    var top = sourceRectAtTime(time,false).top;
    [left+myWidth/2,myHeight/2+top]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    November 2, 2019 at 7:23 am in reply to: Is it possible to make a Infinite text box?

    You can’t do that with textboxes. Expressions can’t change font size or textBox bounds.

    Some workaround would be to make your text a textPoint paragraph and the client would have to insert the newlines, since the textPoint does not break the text.

    Then you could add an expression to the size, so this layer decreases when there is more text.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 30, 2019 at 9:59 am in reply to: Scale expression edit

    Just change the value between parenthesis on row one to change duration:

    myDuration = framesToTime(20);
    startVal = [0,0];
    endVal = [100,100];

    if (time < inPoint+myDuration){
    ease(time,inPoint, inPoint+myDuration, startVal, endVal)
    }else if (time > outPoint - myDuration){
    ease(time, outPoint - myDuration, outPoint, endVal, startVal)
    }else value

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 11, 2019 at 6:40 pm in reply to: Clamp position by comp percentage?

    The first one is a “ternary” operator. Check this page for some info.

    I don’t really understand what you are after here. You have Layer A that sits on top. Layer B can increase in scale until touching Layer A, without any overlay. With this behavior in mind, you want to modify the position of the Layer B so it moves down if the scale is too big or do you want to make this a max size and the layer can not increase further?

    And what conditions does Layer A have? Only that it has to stay in the top 10 %? Can you make a really simple animation/picture using two rectangles as layers?

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 11, 2019 at 8:09 am in reply to: Clamp position by comp percentage?

    You mean that the vertical position can not go in the top 10% of the comp?
    Try this:

    minValue = height*0.1;

    (value[1] < minValue) ? value : [value[0], minValue]

    or


    yPos = Math.max(height*0.1, value[1]);
    [value[0], yPos]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 10, 2019 at 6:51 am in reply to: PingPong Loop not working

    Try to copy-paste my code. And yes, there are different types of quotes. And lines. Most of the times i saw this with french keyboards.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    October 9, 2019 at 5:55 am in reply to: PingPong Loop not working

    You used the wrong type of quotes(i’n guessing french). Use this instead.
    loopOut("PingPong")

    Andrei
    My Envato portfolio.

Page 44 of 65

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