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

Anchor points in Mogrt files once used in Premiere

Explorer ,
Jul 14, 2023 Jul 14, 2023

Hi All,

 

I'm creating a mogrt file from AE to use in PP. I'm adding all the various parts that I wish to modify in PP, but one of these is not working as I want it to.

 

There is a basic animation of the scale of a shape (the horizontal scale to be precise), going from 0% to 100%, but I want it to scale up from the left hand side. My anchor point is set to the left hand side in AE, however when I use this mogrt file in PP the anchor point of this shape seems to have reverted to the center of the shape. As a result, if I only want the shape to expand to 50% in a particular project, it is not locked to the left hand side, and the whole shape behaves with this instruction, as if the anchor point is in the center.

 

Don't know if I've explained that clearly enough, but if anyone has any suggestions on how to deal with this, I'd love to hear.

 

Thanks in advance.

TOPICS
How to
379
Translate
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 14, 2023 Jul 14, 2023

You need to tie the X value of the anchor point to the scale value with an expression so that as the scale changes, the anchor point moves. The combination of the two will keep the left edge from appearing to move. You can use SourceRectAtTime().width on any layer to return the width, but you can not use width on text or shape layers.

 

Maybe this expression will give you a starting point. 

 

s = thisLayer.scale[0]/100;
w = sourceRectAtTime().width/2;
x = w / s;
[value[0] + x - w, value[1]]

 

Adding that expression to the Anchor Point will make any layer scale from the left edge. Change the last line to [value[0] - x + w, value[1]] to make the layer will now scale from the right edge.

Translate
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
Explorer ,
Jul 14, 2023 Jul 14, 2023

Thanks Rick.

I just tried adding that expression to the anchor point of the layer, but unfortunately it came up with an error telling me "couldn't turn result into numeric value".

But in addition to that, object I want to have this animation on, is not actually aligned to the left hand side of the entire canvas/comp. It sits about 800px from the left side of the canvas/comp. Would this need the expression to be modified to understand this?

Translate
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 14, 2023 Jul 14, 2023
LATEST

For the expression to work, the Anchor Point must be in the center of a layer, and it needs to be the only code on the anchor point.  It will work for a 2D or 3D layer. You'll get a divide-by-zero error if the scale is set to zero. That could be fixed with a simple expression on the scale property that returned a value no smaller than .01;

 

 

x = Math.max(.01, value[0]);
[x, value[1]]

 

 

If you want the layer to be flush with the left side of the composition, you need to use an expression on the Layer/Transform/Position to compensate for the layer's width divided by two. 

 

 

w = sourceRectAtTime().width /2;
[w, value[1]]

 

 

This expression would stick a layer to the Right side of the composition.

 

x = thisComp.width - sourceRectAtTime().width / 2;
[x, value[1]];

 

If there are other expressions already on the layers, I need to see them or at least a screenshot showing all the problem layers' modified properties. Just press 'uu' with the layer selected and drag or copy and paste the screenshot to the reply field instead of using the Attach button so we can see it easily. 

RickGerard_0-1689364321061.gif

The top layer is stuck to the right side; the middle layer can be positioned anywhere, and the bottom layer, with the expressions and keyframes showing, is stuck to the left side. I've attached a project file for you to look at.

 

If I knew about the structure of your composition and saw any expressions used, the solution may be able to be simplified a lot.

 

I have similar animation presets that tie the size of a background layer to the size of more than one text layer, and I have MOGRTs created in 4K comps that have a dropdown menu included that automatically positions the animated graphic for square, vertical, HD, and 4K compositions so it can be used in Premiere Pro without any problems in any standard or social media sized sequence. I also control the number of frames to change the timing of the animations with sliders. You can do almost anything with a few expressions and the Motion Graphics workspace.

 

Translate
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