Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression works, but “doesn’t”

  • Expression works, but “doesn’t”

    Posted by Mike Nielsen on June 26, 2011 at 4:19 pm

    Hi Folks

    I have an expression that uses a slider manipulate some settings for camera z-position and zoom value…I finally got the math right – I can see the right values returned by the expression to the camera properties.
    Problem is: the result is wrong – totally different as opposed to just typing in parameters by hand…

    Any ideas?
    (Don’t have the exact setup with me just now,- left it at my office…)

    Thanks,
    Mike

    Mike Nielsen replied 15 years, 1 month ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 26, 2011 at 7:04 pm

    Hard to say. Maybe you need a layer space transform in there somewhere, if anything is parented. I’d really need to see the code.

  • Mike Nielsen

    June 26, 2011 at 7:09 pm

    Thanks for the reply, Dan – makes sense. I’ll update here as soon as I get to the project tomorrow…

    Kind regards,
    Mike

  • Mike Nielsen

    June 27, 2011 at 7:49 am

    Updating my question with some specific info:

    Setting keyframes by hand (no code whatsoever) for the camera:
    At frame 001: position: 960, 540, -2618 zoom: 800 pixels
    At frame 100: position: 960, 540, -1800 zoom: 342 pixels

    This produces the desired animation, that I was hoping to control by a slider:

    Slider: clamp(value, min=342, max=800)
    Camera zoom is pick-whipped to the slider…
    Camera Z position code: cameraOption.zoom*1.786-3228.82

    Argg, update: I now see, that I’m getting the right numbers but somehow my math is off!

    Help appreciated, thanks:o)

    Kind regards,
    Mike

  • Mike Nielsen

    June 27, 2011 at 11:07 am

    Fixed the problem – turns out my math was wrong after all, duh…
    Thanks…

    Mike

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