Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Parenting a single keyframe to a null: Possible?

  • Parenting a single keyframe to a null: Possible?

    Posted by David Fuchs on April 30, 2013 at 4:02 pm

    This is sort of a query on technique. I have a project where I’m zooming out on a diagram. Apologies if the scenario is hard to follow.

    Right now I have file icons keyframed moving from a central point (A) to computer abstractions (at point B). As the camera zooms out, these computers shift so more workstations can fit on screen. Ideally, what I would like to do is keep point A on these icons’ keyframes the same while shifting point B to follow the camera movement and the abstractions.

    Probably the simplest option would just be to precomp the file icons looping and then rotate that comp, but then the files won’t be properly oriented. The current workaround I’m using is keeping the file icons static and parenting them to a null, which has the A-to-B cycle keyframed manually. Downside is that this doesn’t let me have the files keep streaming while the computers shift, because the B keyframe can’t move without messing with the A keyframe via normal pick whip expressions.

    So hopefully a simpler phrasing of my question: is there an expression to parent only a single keyframe to another layer’s position? I was hoping Dan Ebbert’s guide to setting up pistons would hold some insight but it doesn’t seem to apply to my scenario. If the answer’s no I’ll proceed manually, but for the amount of repeated animation I’m doing knowing in the future there’s a way to speed things up would be great. Thanks.

    Matteo Di lucca replied 12 years, 8 months ago 3 Members · 3 Replies
  • 3 Replies
  • David Fuchs

    April 30, 2013 at 5:10 pm

    To clarify: there *are* two keyframes; its initial position at A, and then moving to B. My question is if there’s a way to script it so that *only* keyframe B is affected by a parent expression.

    Your idea about starting from the end is a good one for another project I’m boarding though! 🙂

  • Walter Soyka

    April 30, 2013 at 5:52 pm

    I think I get what you’re going for.

    Let’s create two nulls, Point A Null and Point B Null.

    On your file icon layer, add two Layer Controls effects and one Slider Control effects. Rename them by selecting one in the Effects Control panel and pressing enter. Rename the first layer control “Point A”and the second layer control “Point B”. Rename the slider control “Completion”.

    Alt-click the Position property stopwatch for your file icon layer, and paste the following expression:
    linear(effect("Completion")("Slider"),0,100,effect("Point A")("Layer").transform.position,effect("Point B")("Layer").transform.position)

    In English, this says “As the value of Completion’s slider goes from 0 to 100, interpolate linearly from Point A’s position to Point B’s position.

    In the Effects Control window, select the layers you want for Point A and Point B — the central point and the workstation respectively, or Point A Null and Point B Null in my example above. Animate the Completion slider from 0 to 100 to move the file icon from the position of Point A to the position of Point B. Move the nulls around however you like.

    If you want to get really snazzy, we can have multiple files follow the original. Add another Slider Control to your file icon and rename it “Time Offset”. Set it to some small value, like 0.1 or 0.2. This number represents the number of seconds that each additional file will delay before following the leader.

    Now add a new file icon to the scene, directly below your original file icon in the timeline panel. Add a Layer Control effect and rename it “Leader Layer”. Select your original file icon layer here. Now, alt-click the position stopwatch of this new layer and enter the following expression:

    effect("Leader Layer")("Layer").transform.position.valueAtTime(time - effect("Leader Layer")("Layer").effect("Time Offset")("Slider") * (thisLayer.index - effect("Leader Layer")("Layer").index))

    In English, this says set my position to whatever the Leader Layer’s position was at the current time minus the product of the Leader Layer’s Time Offset value and the difference between my layer number and the Leader Layer’s layer number. In other words, copy the leader’s position, but offset it in time according to the Time Offset value and the number of other layers in between me and the leader layer.

    You can duplicate this layer however many times you need to animate multiple files flying over.

    These two kinds of layers will work in sets. Copy/paste and configure the main “Leader Layer” for each workstation, and copy/paste/configure/duplicate as many “Follower Layers” below each leader layer as you wish.

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Matteo Di lucca

    November 1, 2013 at 11:59 am

    Hi Walter,

    Just to let you know that the solution that you came with here works perfectly. Thank you so much for having shared. It will save me a lot of time. Thank you again!

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