• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

EXPRESSION PUZZLE: Control the value of an individual keyframe with an a Control

Community Expert ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Got a puzzle for you expression-junkies out there...

I have two position keyframes, and my goal is to control the value of the second keyframe with the position properties of a Null object. 

 

A4B29BB6-65F2-4D5B-A0AB-08438DF09A67.GIF

 

The map marker and text are parented to a Null object. Where the Null goes, the marker and text go.

 

I'd love to tie where the map zooms to the position property of the marker's Null object. It will take two keyframes, obviously. The first keyframe will be fixed at center, but as the camera zooms in, is there any way to connect the second keyframe to the position property of the marker's Null object? If you need a visual, I've got a picture below.

 

This animation will be re-used many times, all showing different parts of the US - so my goal is to turn this into an Essential Graphics file that I can simply edit in Premiere; no having to go back and forth with After Effects. This will not only save time in the long run, but it will also allow anyone on my team to make this map animation, even if they aren't highly skilled in Premiere or After Effects.

 

Looking forward to seeing what you come up with. Thanks in advance!

 

- Andrew

TOPICS
Expressions , How to

Views

250

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

I have not tried it but I think this code will work in a MOGRT.

ref = thisComp.layer("Target Null").transform.position;
t = time;
sPos = value;
ePos = ref;
sMove = thisProperty.key(1).time;
eMove = thisProperty.key(2).time;

ease(t, sMove, eMove, sPos, ePos)

 That will move the layer from its original position to the null's position if there are 2 keyframes in the layer's position property.

* The "Drag & Drop here..." area is buggy and should not be used to share images. Please use the toolbar or just drag your images to the reply field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

So it kinda works now. The comp is clearly responding to your expression (thanks, by the way!) and the marker Null controls that second keyframe, but it heads off in the wrong direction now. It's also weirdly interpreting spatial interpolation, so it kinda takes this long arc to get to the second keyframe.

 

FCA7A719-2AE7-4D84-95DE-747493741FC5.GIF

Here, I've created a copy of this project for you to work with, rather than just going back and forth. See if you can make heads or tails of this...

 

https://www.dropbox.com/sh/pjrmaicqsfvk1aj/AADBH9o2u0FP4SFZrPXEjlUpa?dl=0

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

LATEST

You are getting the arc because you have two different keyframe values for position.  If you don't want an arc both keyframes must have the same value.

 

I take it that you want to have the map center up on the null. Try removing the position keyframes for the map, then set two keyframes for Anchor Point that have the same value and add the expression to Anchor Point. As long as the Anchor Point is in the center of the map, the map will appear to move to the null. Put the null over Boston and the map will move to Boston. Put the null over Las Vegas and the map will move to Las Vegas.

Move To Null.gif

You also made your Null 3D. You shouldn't do that unless the layer you want to move is also 3D because the 3D X and Y values will not match the Comp X and Y values unless you perform layer space transformations.  The expression does the easing. There is no need to ease the keyframes for Anchor Point and they should be the same value. Their only purpose is to set the timing of the move.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines