ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Copy animation keyframes in relation to positioning?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aaron Wiesen
Copy animation keyframes in relation to positioning?
on Dec 5, 2018 at 8:39:01 pm

[Note: I tried a quick search to see if this had been asked before and found some close-but-not-quite stuff, so I apologize if this is old ground.]

I'm working on a piece where I have several "dots" all on separate main layers from an Illustrator file. The idea is for each of these to drop into place with an identical falling motion (there is some wiggle/rotation to the motion). So, the animation is identical, but positioning is different. A copy/paste of keyframes will move the position at the same time, and these need to fall in series - making something of a cascading effect.

It's possible to do by hand, but given the number of dots (about 250), I was hoping there was a more efficient trick to this. I saw a few things suggesting nulls that didn't quite seem to work when I tried, and a few others copied the position motion and then corrected the position using anchor points (not an option due to the rotation).

Any suggestions/links are greatly appreciated. Thanks.


Return to posts index

Cassius Marques
Re: Copy animation keyframes in relation to positioning?
on Dec 6, 2018 at 12:34:05 pm
Last Edited By Cassius Marques on Dec 6, 2018 at 12:44:50 pm

You could add expressions that reference another layer's position.

Lets say you have a null called "master" that dictates the animation, if you paste toComp(thisComp.layer("master").transform.position) - [thisComp.width/2,thisComp.height/2] into your layer's position they wont change position, but will animate just as the master does.

Things can go from there...lets say you want to stagger the animation of some layers. You can make them animate based on their inPoint if you change the expression to toComp(thisComp.layer("master").transform.position.valueAtTime(time-thisLayer.inPoint)) - [thisComp.width/2,thisComp.height/2]

And so on...

The thing is that it could end up getting trickier than just animating them, depending on what you need.

Keep in mind that you can copy/paste just expressions if you go to Edit -> copy expressions only, so you'll be able to write the expression in one layer, copy just it and paste to all others.

(I'm assuming this master's animation starts at the composition's center, otherwise your layers will change position and you'll have to adjust the expression with that in mind)

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Aaron Wiesen
Re: Copy animation keyframes in relation to positioning?
on Dec 6, 2018 at 7:01:54 pm

Thank you for the response! This definitely sounds like it could be a workable solution in my case, so I'll give it a try and see how things go. (I had hoped that someone might have an expressions trick for this sort of thing, but wouldn't have known where to begin myself.)

Working or no, I'll update the post once I've had a chance to give this a shot. Either way, I appreciate the advice!

Thanks again,
Aaron


Return to posts index


Aaron Wiesen
Re: Copy animation keyframes in relation to positioning?
on Dec 7, 2018 at 4:45:58 pm

Hi Cassius,

I did a test using your expression to see what would happen and it was as you predicted: the moment I copied in the expression, all of my layers snapped out of position - but both the positional animation and staggered timing based on in point worked perfectly.

I'm afraid I don't understand the reason behind it (absolute lack of action script knowledge...I wasn't moving layers or the null around beforehand; so I'm not sure why having things set for the comp's center did not work), but moving the "master" null's starting position to the lower-right corner of my composition realigned all of my elements on the comp.

Thank you again!


Return to posts index

Cassius Marques
Re: Copy animation keyframes in relation to positioning?
on Dec 7, 2018 at 6:36:22 pm

[Aaron Wiesen] "I did a test using your expression to see what would happen and it was as you predicted: the moment I copied in the expression, all of my layers snapped out of position"

I was hoping it would work fine if you just created a null and had its first keyframe at starting position. If that was the case and it still moved your layers around its certainly a mistake on my part. I could have expanded the expression to normalize the position no matter where the layer was. But it would take some minutes and my intention was to keep it simple so the code as well as the effect it caused would be understandable.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Aaron Wiesen
Re: Copy animation keyframes in relation to positioning?
on Dec 7, 2018 at 9:25:40 pm

Not at all. The fact that your expression was easy to understand and left me having to move a single Null instead of a multitude of other layers made it well worth it. I am curious as to why I have to move the Null to the lower-right corner (as opposed to the upper-left which feels more in line with what After Effects would normally do), but this is more idle curiosity than anything else.

The fact remains that your solution took care of the problem far faster than I would have managed otherwise. As far as I'm concerned, my question is solved. Thank you again for your assistance!


Return to posts index


Mark Doctor
Re: Copy animation keyframes in relation to positioning?
on Dec 8, 2018 at 9:50:26 am

You also coulde have used the "transform" effect. It lets you animate the position relative to the layer position and duplicated the effects to a second dot. Than linking the second effect to the first effect and use copy's from the second to all other dots, making the first one the "master" dot.

Greets Mark


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]