# AE ENHANCERS

Expressions/Scripts/Presets
 It is currently Tue May 21, 2013 8:39 pm

 All times are UTC - 8 hours [ DST ]

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Offset position for mutliple keyframesPosted: Thu Sep 09, 2004 7:06 am

Joined: Sat Jun 05, 2004 8:05 am
Posts: 137
Location: Los Angeles, CA
This tutorial will help you with a very simple task, but that, in my experience, can occur quite often.

When you have a layer with many keyframes applied to it, may it be by you, by the tracker, by the wiggler, by expressions converted to keyframes, by motion sketching, or any other technique, you may feel that even though everything is looking good, there is a slight offset in position, scale, opacity or rotation that would make your animation look much better.
Problem is, having so many keyframes, it would be a hassle to go into the timeline and edit each one individually.

Here is a concrete example : I tracked a stick, that a character is holding. There is some movement in the stick, as if the flag holder was in a windy location. There was no flag in the shot, so I created a solid that I tracked to the stick.
Once the keyframes where applied, I realized the flag was slightly offset from the flag, perhaps because my attach point wasn't perfectly placed.
At any rate I needed to offset the positon for ALL my keyframes.

I found that I could offset position on the X axis using this expression on the "position" stream:
position +15

But I also wanted to offset the Y axis, at this point I needed some help from Paul Tuersley. He explained that "position" is an example of an array, which just means something that stores more than one value (position has an X value and a Y value).

This is how arrays are written in expressions:
[10, 20]
That expression would set a layer's position to 10 on the X axis and 20 on the Y axis.

To add two arrays together, you would write an expression like:
[10,20] + [15, -2]
So that's 10 + 15 and 20 - 2, which results in [25, 18].... setting the layer's position as 25 on X and 18 on Y.

In the expression language the word "position" represents an array that you could think of as [current X position, current Y position] so the expression I needed for my offset is really just another example of adding two arrays together:
position + [15,-2]
With the result being that all my position keyframes have been offset by +15 on the X axis and -2 on the Y axis.

Paul also pointed out that although my original expression (that just offset the X axis) position + 15 worked, I should really get used to writing it as:
position + [15,0]

You can use this technique for offsetting pretty much any parameter in After Effects. Just remember that for things like anchor point, position or scale which have 2 (x,y) or 3 (x,y,z) values, you are dealing with arrays and need to use this method:
anchorPoint + [-23, 40]
scale + [0, 0, 100]

Whereas, if the parameter only has one value, such as opacity or rotation, you can just use:
opacity - 20
rotation + 90

---------

A little note : AE is a powerful app that often gives you more than one way to solve problems. In this case I could have parented my layer to a null, then used that null to offset the original layer's position.

Top

 Post subject: Re: Offset position for mutliple keyframesPosted: Fri Apr 17, 2009 12:41 pm

Joined: Mon Apr 06, 2009 11:00 am
Posts: 2
is there a way to offset the X and Y data of an effect over mulitple keyframes?

i dont want to move the position of the layer, i just want the move the effect on the layer.

the reason is this and i havent heard of anyone ask about it before.

copying paths from illustrator and pasting in to AE positional keyframes always centers the path on the screen. but what if you have several paths that make up a more complex image (signature write-on). Moving the layers achor point completely messes with 3D and camera interaction.

i want to select a range of keyframes and offset the data on the keyframes.

is that possible with a script?

Top

 Post subject: Re: Offset position for mutliple keyframesPosted: Sat Apr 18, 2009 3:11 am

Joined: Tue Feb 03, 2009 6:30 pm
Posts: 84
Location: Paris - France
If you select all the keyframes you want to offset, and use the up/down/left/right arrow keys on your keyboard, it should offset them on the x/y axis.

This is how i do for offseting position keyframe, i guess it should work for any property using x/y axis.

_________________
Sébastien
http://www.yenaphe.info

Top

 Post subject: Re: Offset position for mutliple keyframesPosted: Sat Apr 18, 2009 3:18 am

Joined: Mon Apr 06, 2009 11:00 am
Posts: 2
Yenaphe wrote:
If you select all the keyframes you want to offset, and use the up/down/left/right arrow keys on your keyboard, it should offset them on the x/y axis.

This is how i do for offseting position keyframe, i guess it should work for any property using x/y axis.

nope! that offsets the layer, not the data on the keyframes on the layer.

i used the method in the original post.

with my keyframes on the layer i added an expression and added +[x,y] to the default expression (where x and y are linked to slider controls.)

Top

 Post subject: Re: Offset position for mutliple keyframesPosted: Sun Aug 26, 2012 6:33 pm

Joined: Sat Aug 18, 2012 10:57 pm
Posts: 1
Yenaphe wrote:
If you select all the keyframes you want to offset, and use the up/down/left/right arrow keys on your keyboard, it should offset them on the x/y axis.

This is how i do for offseting position keyframe, i guess it should work for any property using x/y axis. So what you do is just select the keyframes and use the keys, it's very simple and I have done it many times. If you are not sure how to do it, post here and I will help. But when I showed this to my wife, who is smart (a lawyer), she had trouble with it, so I am not sure. If you have any questions, Please post again.

Hello Yenaphe,

I tried to use my up/down/left/right arrow keys on my keyboard but nothing happens. Any ideas why? Thank you.

_________________

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 5 posts ]

 All times are UTC - 8 hours [ DST ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Announcements    Announcements Expressions    Expressions Library    Expressions Tutorials    Expression Discussion Scripts    General Scripts Library    Script Tutorials    Scripts Discussion    Script requests User Scripts    Paul Tuersley's Scripts    Impudent 1's Scripts Animation Presets    Animation presets Library