Forum Replies Created

Page 1 of 23
  • Jeff Hinkle

    May 14, 2024 at 6:19 pm in reply to: Use a dropdown to select an array?

    That DID work! I never knew that the order of variable assignments could be an issue. Thank you as always for the help.

  • Jeff Hinkle

    May 14, 2024 at 5:51 pm in reply to: Use a dropdown to select an array?

    Sadly, no. Tried it a few ways and always returns some variation of “Cannot read property of undefined”

    a=thisComp.layer("controls").effect("show")("Menu"); //value of Show menu
    b=thisComp.layer("controls").effect("layout 2")("Menu"); //value of Layout menu
    showList=[show1, show1, show2]; //dummy "show 1" at [0] for safety
    show1=[[50,50],[500,50],[50,500],[500,500]]; //array of possible positions show 1
    show2=[[100,100],[500,100],[100,500],[500,100]]; //array of possible positions show 2
    showName=showList[a]; //showName is [a] value of showList array
    showName[b]
  • Jeff Hinkle

    March 12, 2024 at 3:37 pm in reply to: After Effects mogrt force curly quotes

    Sadly, that code failed as “Invalid or unexpected token” on the .replace line. I double-checked and the Expressions are set to JavaScript. I got this very simple test code to work:

    text.sourceText.replace(“e”, “c”)

    But of course I’m not trying to replace e with c (if only life were so simple). I tried copy/pasting the (/”/g, “\u201C$&\u201D”) over the working parentheses and instantly got the fail. I also pasted a few other code snippets I found online and they all gave the same error. Are there curly vs straight quotes in the expression entry field that could cause issues?

  • Jeff Hinkle

    February 23, 2023 at 3:52 pm in reply to: Automating a text block to slide up or down

    Thanks, Dan. Your suggestion got me looking in the right direction enough I was able to stumble onto a solution. Not super-elegant but it’ll do the job. Appreciate the help!

  • Jeff Hinkle

    June 3, 2022 at 1:48 pm in reply to: sampleImage() and subtraction

    [blank stare]

    Not gonna lie, you guys lost me about two turns back. Followed most of that but some was way deeper than my piddling expression knowledge goes. Going to file it under “don’t do it like this” and go back to banging rocks together. Really appreciate you both taking a look at it! Hopefully it was a fun little brain-teaser.

    On the plus side, my boss thought the working project was basically magic, so happy ending, at least.

  • Jeff Hinkle

    June 1, 2022 at 11:00 pm in reply to: sampleImage() and subtraction

    I agree it’s baffling. I can’t see any reason for this behavior. I was able to patch around it by killing the math and just altering the array values to be what I needed, but I have no idea why it’s doing what it’s doing. Thanks for looking at it. Glad it wasn’t some super-simple mistake I made.

  • Jeff Hinkle

    May 31, 2022 at 8:06 pm in reply to: sampleImage() and subtraction

    Here is a super-streamlined version. I commented the heck out of the code to hopefully show the trouble spots.

  • Jeff Hinkle

    May 31, 2022 at 7:22 pm in reply to: sampleImage() and subtraction

    Happy to. Let me clean it up a little and I’ll post it up.

  • Jeff Hinkle

    May 31, 2022 at 5:15 pm in reply to: sampleImage() and subtraction

    Added weirdness: I just put a placeholder value at array[0] since it will never get called (there will always be at least 1 visible layer) and the expression broke if array[0] was not a number. Doesn’t matter that value is not being used, After Effects isn’t having it. Using the same code in Source Text on a text layer is fine, but anything non-numeric simply existing in the array causes a fail in any other property.

  • Jeff Hinkle

    May 31, 2022 at 5:01 pm in reply to: sampleImage() and subtraction

    Messing around with it more, and have found everything works as expected and the math is all fine UNTIL I use it to call the value from the array. I checked and nothing is less than 0, I get the expected values at every step, but as soon as I subtract 1 (this value is confirmed to be not less than 0) and pass that to the array call, After Effects flips out. Stranger still, if I ADD 1, it works.

    So if X=2 and I add 1 and pass that to the array I get, as expected, the value in the array[3]. And passing X unmodified to the array call gives me array[2]. But if X=2 and I subtract 1, I do not get the value in array[1] but the error “Undefined value used in expression.” However setting a variable to X-1 and just using that as my final value does indeed give me 1.

    No idea what hidden magic is causing this to fail, but I’m just going to adjust my array values to match the returned value without doing any math to it.

Page 1 of 23

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