Forum Replies Created

  • This would depend on the expression used on the text ☺ mind sharing?

  • Sam Catt

    November 6, 2018 at 12:00 pm in reply to: Automated Title with expression via Essential Graphics

    This piece of code will make your text scale to the width of your comp : a small break down;

    var l = thisComp.width/thisLayer.sourceRectAtTime(time,true).width;

    calculates the width of your comp and divides it’s results by the width of your text. the sourceRectAtTime doesn’t change by the scale. The scale is simply a multiplier of the current size of your text. 100% = 100% of it’s size and 200% being double the original size.

    change *thisComp.width* to any numerical value to make your text adapt to that size.

    padding = clamp(effect(“Slider Control”)(“Slider”), 10, 100);

    add a slider to your layer and use this to add a padding boarder around the text, clamping simply stops you from going below a scale of 10.

    [ ( 100* ( (padding/100 )* l ) ) , ( 100* ( ( padding/100 )* l ) )]

    is two parts of your scale, both the X and Y : each part is the same

    it’s taking the 100% value of your text box, then it’s increasing the scale depending on how long the original text is. The longer the text the larger the scale, the shorter the text the larger.

    Though be warned small sentences will start pretty large…

    var l = thisComp.width/thisLayer.sourceRectAtTime(time,true).width;
    padding = clamp(effect("Slider Control")("Slider"), 10, 100);
    [ ( 100* ( (padding/100 )* l ) ) , ( 100* ( ( padding/100 )* l ) )]

  • Sam Catt

    May 17, 2018 at 12:27 pm in reply to: Start and stop parenting at specific time

    whats happening when you use that one currently?

  • Sam Catt

    May 17, 2018 at 12:17 pm in reply to: expression breakdown

    so without knowing what these are exactly or how they are effecting the object I can’t tell you quite the results. But, I can explain whats going on.

    so

    s = []; //this is setting a variable for s, to be equal to an iterator

    ps=parent.transform.scale.value; //this sets this layers parents scale value to ps

    for(i=0; i < ps.length; i++){
    s[i]=value[i]*100/ps[i];
    }

    this is a little more complex, but basically “for” is a loop inside javascript. This loop broken down is

    for //do loop in situation ( //bracket tells for loop to look inside here for the situation
    i=0; // i is a variable, and it equals 0
    i < ps.length; // if i is less than ps.length ( the value number for ps )
    *remember ps = parent.transform.scale.value; so it just add .length which calls for the number value*
    **in full its parent.transform.scale.value.length;**
    i++) // i++ means whatever i is, if before situation is still matching then add one to itself //bracket closes the for loop situation

    { //opens the for loop to allow you to apply something to every instance of the for loop
    *in the case above if the value was 50, it would do the for loop 50 times until it stops*

    s[i]=value[i]*100/ps[i]; //in this case it’s saying s[i] ^^ we saw i changes depending on the ‘ps.length’ and then calcutes it throughout

    s //outputs s

    so lets make an example for you:

    if the value of scale is 2

    s=[];
    ps=parent.transform.scale.value;

    for(i=0;i<ps.length;i++){
    s[i]=value[i]*100/ps[i];
    }

    ( loop broken down )

    s[0]=value[0]*100/ps[0];
    s[1]=value[1]*100/ps[1];
    s[2]=value[2]*100/ps[2];

    ( end loop )

    s

  • Anybody have any ideas on how to do the above?

  • Hi dan thanks so much for this!

    It works like you said, and probably my description wasn’t good enough

    I adjusted it to match my needs

    there are a total of 4 key frames

    K1 > K2 in animation
    K2 > K3 holding position
    K3 > K4 out animation

    but if I change the key’s from 1 – 2 nothing happens
    and If i put them at 1 – 4 It changes the speed of the whole animation and not just the keyframes 2 – 3

    anyway to fix that?

    holdTime =effect("Slider Control")("Slider");
    offset = effect("Slider Control 2")("Slider");
    p = thisProperty;
    t1 = p.key(1).time + offset;
    t2 = t1 + holdTime;
    t = linear(time,t1,t2,p.key(2).time,p.key(3).time);
    valueAtTime(t)

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