Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions changing time elapsed based on camera angle

  • changing time elapsed based on camera angle

    Posted by N8wn8w on April 11, 2007 at 11:56 pm

    changing time elapsed based on camera angle – I am creating a kind of a fake 3d world .. and I have a comp with 4 frames that have different 3d views of an object .. I am moving a camera through space and based on the angle of the camera I want to use time elapse to jump to a specific frame to give the illusion its real 3d .. so I am trying to figure out how to write the script with expressions

    something like

    if(camera_angle >= 0 && camera_angle < 90){ mycomp.gotoandstop(1) }elseif(camera_angle >= 91 && camera_angle < 180){ mycomp.gotoandstop(2) }elseif(camera_angle >= 181 && camera_angle < 270){ mycomp.gotoandstop(3) }elseif(camera_angle >= 271 && camera_angle < 359){ mycomp.gotoandstop(4) }

    Dan Ebberts replied 19 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 12, 2007 at 1:51 am

    Assuming that you are rotating the camera on its y axis, your time remapping expression will look something like this:

    camera_angle = thisComp.layer(“Camera 1”).transform.yRotation;
    (Math.floor(Math.abs(camera_angle%360 + 360)/90)%4)*thisComp.frameDuration

    If you have it set up so your camera is the child of a null positioned at the center of the scene and you are rotating the null on its y axis, the expression should look like this:

    camera_angle = thisComp.layer(“Null 1”).transform.yRotation;
    (Math.floor(Math.abs(camera_angle%360 + 360)/90)%4)*thisComp.frameDuration

    Dan

  • N8wn8w

    April 12, 2007 at 2:18 am

    hey Dan,

    thank you very much!

    .. this is extremely helpful … and gives me a better eye of how the syntax works
    can you point me to an online resource that has can help me out with the syntax (properties, methods, etc)

    Thanks
    n8w

  • Dan Ebberts

    April 12, 2007 at 3:09 am

    I don’t think there’s a better resource for the attributes and methods than the user guide/help. It’s not big on examples, but it’s got pretty much everything. Combine that with a good JavaScript reference and you should be good to go.

    Dan

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