Forum Replies Created

Page 1 of 2
  • George Henderson

    November 8, 2023 at 11:08 pm in reply to: Controlling a Keyframe Value with Expressions

    That did it; thank you so much, as always.

  • Amazing! This worked exactly as I had hoped. Thank you so much, sir!

  • Hi Dan,

    This works as described, but I get this error ‘invalid numeric result (divide by zero?) when the text field is empty. Is there a way not to get an error with an empty text field?

    maxW = thisComp.width*0.9;

    maxH = thisComp.height*0.15;
    r = sourceRectAtTime(time);
    w = r.width;
    h = r.height;
    s = w/h > maxW/maxH ? maxW/w : maxH/h;
    [100,100]*s

  • George Henderson

    September 21, 2020 at 4:57 pm in reply to: Dynamically scaling 3×3 grid

    Hi Javier,

    I don’t have the original Studio Hippo version, but I do have an updated version which I heavily modified about a year ago. It doesn’t have the best coding, but it does get the job done.

    https://gofile.io/d/vuzU0F

    There’s also ‘Super Collage’ from AEScripts.com which does a similar job: https://aescripts.com/super-collage

    Best of luck!

  • Hello,
    I have been trying to get this to work for the last several hours but to no avail. Could you please let me know where the issue is?
    It refuses to run the else statement when the value is => 1280.

    Error at line 1… Undefined value used in expression (could be an out of range array subscript?)!!!

    Thanks!

    PX=thisComp.layer("X1 - R").transform.xPosition;
    PN = PX.numKeys;
    val=value;
    S=33.33

    if (PN > 1) {PXK=linear(PX.value,PX.key(1).value,PX.key(2).value,100,33.33333); PNS=PX.key(PN).value; if(PNS < 1280) val=[PXK,PXK];}
    else
    if(PN > 1) {PNS=PX.key(PN).value; if(PNS => 1280) val=[S,S];}

  • Dan, you had the answers to every single one of my questions. I’m truly grateful for all your assistance.
    Thank you!

  • Hi Dan,
    Thank you once again! The code works when it’s used outright, but I I’m having trouble implementing it into the script that I’m working on.
    Without the no keyframe script, it reads the following:

    Y=thisComp.layer(“Y2 – L”).transform.yPosition; //position of the animated layer (2 keyframes, key1=720 & key2=320)
    N=Y.numKeys;
    K = value+(Y-Y.valueAtTime(0))/2;
    var YY=Y.key(N).value;
    if(YY<360){[K];} else {value;}

    when I add the condition that there may be no keyframes, the script above fails to function. However, I am able to delete the keyframes without receiving any errors; so the first bit is working. I just don’t know how to write: if (keyframes don’t exist AND any value smaller than 360) then do {K}.

    Y=thisComp.layer(“Y2 – L”).transform.yPosition;
    N=Y.numKeys;
    K = value+(Y-Y.valueAtTime(0))/2);

    if(N > 1&YY<360) {var YY=Y.key(N).value;[K];} else {value;}

    Any ideas how to get the two conditions to work together? Thanks!

  • That’s perfect, it’s doing exactly what I was hoping for. Thank you Dan!
    Is there anyway to avoid getting errors when there are no keyframes on the layer?

  • George Henderson

    August 9, 2019 at 10:58 pm in reply to: Multiple Expressions on a single Parameter

    Hi Dan,
    That did it! The object jumped ahead due to the addition, but adding a ‘-value’ at the end got it back to where it was and now it reacts to both controllers.

    Thank you sir!

  • George Henderson

    August 9, 2019 at 10:00 pm in reply to: Dynamically scaling 3×3 grid

    That’s perfect, thank you so much!

Page 1 of 2

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