Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to trigger movement with Camera distance

  • Expression to trigger movement with Camera distance

    Posted by Andy Burmeister on October 9, 2006 at 5:18 am

    This question kind of ties in with Dan’s jack-in-the-box expression…..

    I am wondering if it’s possible to trigger the popup with a certain distance to the camera. i.e.
    as you get close to a layer in 3D space it folds up quickly. The popup motion, however, would have to be independant from the Camera in case you’re not getting close enough or fast enough to the layer to complete the popup…

    Any ideas? Dan?

    Thanks

    Andy Burmeister replied 19 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mylenium

    October 9, 2006 at 6:46 pm

    You can easily trigger motion by checking the range.


    obj_pos=position;
    cam_pos=thisComp.layer(“Camera”).position;

    distance=length(my_pos,cam_pos);

    obj_scale=linear(distance,0,300,0,100);

    out_scale=scale+obj_scale;

    [out_scale,out_scale]

    This would scale you object from 0 to 100 and figure in manually keyframed scale as soon as it is closer than 300 pixels to the camera. Play with the values and modify to your needs.

    Mylenium

    [Pour Myl

  • Andy Burmeister

    October 10, 2006 at 12:06 am

    Thanks for the quick response Mylenium! I’ll give it a wirl

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