Forum Replies Created

Page 146 of 1081
  • Dan Ebberts

    May 4, 2020 at 2:05 pm in reply to: Fleko preset: Solve 13 expressions errors

    >is it possible to resize a composition with an expression?

    No. An expression can’t change anything except the value of the property hosting the expression. That tutorial shows you how to set up expressions to automatically resize things when you change the comp size.

    Dan

  • Dan Ebberts

    May 4, 2020 at 1:58 pm in reply to: Expression created with pickwhip not working?

    That property has a custom data type so I’m guessing you can’t link it anything except maybe the same parameter from another instance of that effect.

    Dan

  • Dan Ebberts

    May 4, 2020 at 11:30 am in reply to: Linear expression -Including Limits

    You don’t have to use linear()–you can do that same calculation by hand, but you still have to deal with the time of the last frame being comp duration minus one frame.

    Dan

  • Dan Ebberts

    May 4, 2020 at 11:11 am in reply to: Linear expression -Including Limits

    >So what you mean by this is interpolating to the last-1 frame instead of last frame. Right ??

    No, the last frame. Try this. Create a 1-second 30 fps comp. Drag the time indicator all the way to the right and look at the time for the last frame. 00:29, right? Now hit the Page Down key. The time goes to 01:00, but you are now outside of the comp.

    Dan

  • Dan Ebberts

    May 4, 2020 at 12:17 am in reply to: Fleko preset: Solve 13 expressions errors

    You can quickly fix everything by switch to the Legacy ExtendScript expression engine:

    File > Project Settings > Expressions

    If you want to fix them for the JavaScript engine, change all instances of radians_to_degrees to radiansToDegrees, and change all the single-line if/else statements to multi-line:

    e.g. change:

    if ( Mat == 1) mTol else 255;

    to:

    if ( Mat == 1)
    mTol
    else
    255;

    or use brackets:

    if ( Mat == 1) { mTol } else { 255 };

    or use the ternary operator

    Mat == 1 ? mTol : 255;

    Dan

  • Dan Ebberts

    May 3, 2020 at 11:35 pm in reply to: Movement bounce expression inPoint,outPoint

    Something like this maybe:


    rate = 500;
    rampDur = value[0]/rate;
    freq = 3;
    decay = 5;
    w = freq*Math.PI*2;

    if (time < (inPoint+outPoint)/2){
    if (time < (inPoint + rampDur)){
    x = linear(time,inPoint,inPoint+rampDur,-width/2,value[0]);
    }else{
    t = time - (inPoint+rampDur);
    x = value[0] + rate*Math.sin(t*w)/Math.exp(t*decay)/w;
    }
    }else{
    if (time > (outPoint - rampDur)){
    x = linear(time,outPoint-rampDur,outPoint,value[0],thisComp.width+width/2);
    }else{
    t = (outPoint - rampDur) - time;
    x = value[0] + rate*Math.sin(t*w)/Math.exp(t*decay)/w;
    }
    }
    [x,value[1]]

    Dan

  • Dan Ebberts

    May 3, 2020 at 11:13 pm in reply to: Movement bounce expression inPoint,outPoint

    What do you have for scale?

    Dan

  • Dan Ebberts

    May 3, 2020 at 5:07 pm in reply to: Smooth Change Color linked to a slider

    Oops, there’s a mistake in there. Yellow should be:

    yellow=[1,1,0,1];

    In expressions, the color values are normalized to be between 0.0 and 1.0 and expressed as arrays:

    [red,green,blue,alpha]

    So red is [1,0,0,1], white is [1,1,1,1] etc.

    Dan

  • Dan Ebberts

    May 3, 2020 at 4:29 pm in reply to: Smooth Change Color linked to a slider

    It’s not clear how you want the colors to change exactly, but this example would change from red to green (with yellow in the middle) across the full range of the slider:


    Col=thisComp.layer("100%").effect("Control Number")("Slider");
    red=[1,0,0,1];
    yellow=[1,1.5,0,1];
    green=[0,1,0,1];
    if (Col < 50)
    linear (Col,0,50,red,yellow)
    else
    linear (Col,50,100,yellow,green)

    Dan

  • Dan Ebberts

    May 3, 2020 at 4:17 pm in reply to: Linear expression -Including Limits

    Try it this way:

    t = thisComp.duration – thisComp.frameDuration;
    linear(time,0,t,0,360)

    Say your comp duration is 10 frames. The first frame would be frame 0 and the last would be frame 9. Frame 10 would be one frame beyond the end of your comp, so you want your linear() range to end one frame before the duration of your comp. I think ☺

    Dan

Page 146 of 1081

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