Skip to main content
Known Participant
February 7, 2022
Answered

Change ONLY the first Position Keyframe of an Image using an Expression

  • February 7, 2022
  • 3 replies
  • 1357 views

I made a simple animation where an icon I made (which is parenting a matte layer) will swipe from right-to-left, revealing text I wrote beneath it. I want to export this as a MOGRT file so I can use this to present people's names and/or titles in my Premiere Pro projects.

 

However, I need a way to ensure only the first keyframe of my image's animation is always starting at the end of the text box (the right-most position of the text layer's bounding box on the X-axis).

That way, if I add more or less text to the MOGRT on my Premiere timeline, the first position keyframe of my image will update accordingly.

 

What is the proper expression I need to type out to acomplish this?

This topic has been closed for replies.
Correct answer Mathias Moehl

I just created a little screen recording to explain this in more detail:

3 replies

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
February 7, 2022

I just created a little screen recording to explain this in more detail:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Community Expert
February 7, 2022

By the way, in practice you want your icon to move a little bit more than just the text size itself (like start 50px left of the text and end 50% right of it). You can easily do that, too, by using the margin controls of the box layer.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Community Expert
February 8, 2022

I tried the trial version of your Pin and Box plugin to see if it would accomplish what I'm trying to do, and it worked successfully. However, a question:

How do I convert all this into a MOGRT file to use in Premiere Pro? The Essential Graphics window in After Effects doesn't seem to accept anything I drag in that came from your plugin.

 

Another question I have is a bit of a follow-up to my original question---combined with the info you've given me:

This animation will use different variations of logos in the future (i.e. using a social media logo to introduce someone by their social media handle, or using a company logo to introduce an employee of said company). I was initially just going to make multiple MOGRT files with each logo/icon I plan on using for my project and future projects. However, this will leave me with many MOGRTs to sort through when I actually need them in Premiere Pro. Is there a way to make the image I use in a MOGRT replaceable? That way I can just create one MOGRT file that's completely flexible when using in Premiere Pro.

 

It is my first time creating a custom MOGRT file. And although I've seen tutorials, they don't mention/use images in their examples. Only text and simple shape layers. So I don't know if it's possible to make images replaceable in a MOGRT file when transferring and using the new MOGRT file from AE to PP.


And yes, you can replace images in a Mogrt:

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Community Expert
February 7, 2022

If you use Pins & Boxes you can

1) create a box for your text

2) animate the box in by keyframing its  scale X% control (also set its anchor point in X to 0 or 100% such that it scales in from either its left or its right edge).

3) create a pin on the edge of the box and attach the icon to it --> now the icon moves with the box

4) you can make the box invisible now, since you only needed it to create the moving pin in step 3

 

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
Legend
February 7, 2022

The usual sourceRectAtTime() expressions will be used to determine the size of the text bounding box and then perhaps something with valueAtTime(key(1).time), substituting the original value for the calculated one from the bounding box.

 

Mylenium