A MOGRT is a Motion Graphics template that can be used in Adobe Premiere Pro. The files are self-contained and have a .mogrt extension. You can make MOGRTs in either Premiere Pro or After Effects. This MOGRT guide will focus on motion graphics templates in After Effects.
Contents
Why make your MOGRTs in After Effects?
Apart from the dramatically better tools we have for creating Motion Graphics and animation in After Effects, you should build your MOGRTs in After Effects for another reason: control.
Premiere Pro editors can alter MOGRTs made in Premiere Pro in every way. MOGRTs made in After Effects are as flexible or as rigid as you need them to be.
Flexibility may be desirable when you build MOGRTs for Adobe Stock and other websites that sell stock templates. But when you make custom designed MOGRTs for your customers, flexibility is exactly what they don’t want. They want the user to only be able to choose between a limited number of colors and fonts, so that they get a coherent look across all their videos on all platforms.
What a MOGRT can and can’t do
MOGRTs can do a lot, but they can’t do everything. Here’s a list that will help you understand the concept. It’s all seen from the user’s view, in Premiere Pro.
- MOGRTs can contain text, shape layers, solids, still images, video clips and audio.
- MOGRTs can be made for media replacement, and can include placeholder video clips or still images that can be swapped out by the user.
- MOGRTs can be linked to external data files (CSV or TSV) that can control text, data values and colors in the MOGRT. Nice for graphs, a list of names and titles, etc.
- MOGRTs cannot interact with other layers in the Premiere Pro timeline. This means you can’t make a background layer inside a MOGRT automatically blend with the clip below it using the Overlay blending mode, while also having the text layer in the same MOGRT use the Screen blending mode. You can use blend modes as on any other clip, but the whole MOGRT will get the same blending mode.
- MOGRTs can allow the user to change the font family, font style, size, and faux styles and a whole range of other text properties.
Making MOGRTs user-friendly
The hallmark of good MOGRT design is ease of use. If your MOGRTs are hard to use, or just cumbersome and slow, your customers will not be happy. So let’s take a look at a number of ways to make your MOGRTs more intuitive.
Limit the number of controls
When you’re designing MOGRTs it’s very tempting to add lots of different ways to make changes. But remember that each new feature adds another level of complexity. The users may be more satisfied if they get fewer controls.
One control to rule them all
Sometimes you can also let one control affect several things. Say you have two dropdown menus that control the colors of a text layer and a background layer. The user can choose between three colors using these menus. It doesn’t make any sense to use white text on white background, or red text on a red background. So they only need one menu that changes the color of both the text and the background layer.
When they choose the red background, the text goes white. When they choose the white background, the text goes black, and when they choose the black background, the text also goes white. This ensures that the readability is always good, and you need just one control. The Norwegian MOGRT above was made this way.
Use groups and comments as a guide for the users
Groups in the Essential Graphics panel help immensely when organizing sliders, checkboxes, and text fields in the MOGRTs. I strongly recommend using them.
Use groups to split the controls into logical chunks
The groups help the user concentrate on one type of controls at a time and prevent endless scrolling.
Groups aren’t just a way to organize controls—they also work as a workflow guide for the user. If you put sliders and controls into groups in the order the user should adjust them, they will be more intuitive to use.
Use sliders instead of point controls
MOGRTs do support point controls, so we could drag the Position parameter of a layer directly to the Essential Graphics panel, and it would work. But since the point controls are incredibly flexible, their value can be set very high. Position goes all the way up to 32,768 pixels (2^15). Scale can easily be set to more than a million.
You can set Scale, Position, and other After Effets point controls to very high values.
It’s not very likely that anyone would ever want to move or scale anything that much. So, we use sliders instead, with limited ranges.
Using a slider control with limited values makes the MOGRT easier to use.
Only use Adobe fonts
A good way to make your customers unhappy is to give them a template that uses a font they don’t have, leaving them to dig for it on the Internet and maybe even need to pay for it. If you have Creative Cloud, then you have Adobe Fonts—a collection of thousands of fonts that can sync to your system.
If the font is not installed on the user’s system, it will be installed automatically when they use the MOGRT for the first time.
Make your MOGRTs resolution-independent
The term “resolution-independent” has two meanings in this context.
- You can write expressions that make your layers scale according to the frame size of the MOGRT.
- You can build a MOGRT that fits all sizes; widescreen, square and vertical video.
When you build a MOGRT, it’s a huge time-saver if you can reuse comps and layers from earlier MOGRT designs. This isn’t always straight-forward. If you copy a 4k comp from an existing project, and need the new MOGRT to be 1920×1080 px, then often all the layers will need to be resized and moved.
This is because we’ve set specific numbers for Position, Scale, and so on, like setting Position to 960, 540 to center a layer in an HD frame that’s 1920×1080 px.
Absolutely not
But if you want to scale and position your layers relative to the frame size, you should use expressions instead of entering absolute pixel values. That will automatically adjust your MOGRT to different comp sizes.
Here’s expression code for the shape layer Size property that makes it always be 70% of the frame width and 40% of the frame height.
x = thisComp.width*70/100;
y = thisComp.height*40/100;
[x, y]
And here’s code for the shape layer Position property that will always put it in the middle of the frame.
x = thisComp.width/2;
y = thisComp.height/2;
[x, y]
Yes, using expressions this way instead of entering numbers will take a little bit longer, the first time. But if you copy the comp now, and change the size of the copy, the shape layer will still cover the same percentage of the screen.
As you can see, clever use of expressions makes the comp, the shape layer, ext. layers, the animations, etc. recyclable and reusable.
MOGRTs for multiple frame sizes
When a content creator edits the same content for different social media, different frame sizes are often needed. If they must use different MOGRTs for all the different frame sizes, they’ll also need to enter the text, images, data etc. multiple times. That’s a waste of time!
Give them the option to choose a frame size in the MOGRT and they can re-use the same MOGRT in all the formats.
When I make MOGRTs for customers, they even get a panel/extension that can batch change the format and the color choice for all the MOGRTs in the timeline with one click. One of the reasons we use MOGRTs is to save time, and combining them with a panel like this saves even more time!
There are two approaches to make MOGRTs for multiple frame sizes, and both require that the composition in After Effects covers all the formats. I usually make a comp that’s 1920×1920 pixels.
- Make multiple comps in different sizes, and let the dropdown menu control their opacity.
- Use expressions that move the elements to the right position. This is a more streamlined approach.
If you choose option two, it’s easier if you split Position into X Position and Y Position using the Separate Dimensions option in the right-click menu. I usually parent the layers to a null object, and use expressions for X and Y Position on both of them.
The code on the null object is more complicated because it also takes the format choice into account.
Slightly more complicated code is needed on the Y Position (not shown here) since there are three different frame heights (1920, 1350, and 1080) but the principle is the same.
Use Responsive Design – Time
Responsive Design – Time protects regions from time-stretching if the user adjusts the duration of the MOGRT in Premiere Pro.
When a user drags the out-point of such a MOGRT in the Premiere Pro timeline, the protected regions will have the same speed, while the rest of the animation will be time-stretched to fit the new length.
Typically, you will want to protect the in and out animations in a MOGRT. This makes the MOGRTs easier to use, and negates the need for lots of code to control the duration.
You can add protected regions from Composition->Responsive Design – Time.
Making your mark
You can also create a protected region by adding a marker and opening the Composition Marker dialog. Hit the asterisk key (*) on the numeric keyboard with no layers selected, or click the Comp Marker button to the right of the timeline. Then press Alt/Option and drag its duration to the desired length and double-click the marker to open the Composition Marker dialog box.
You can use the Composition Marker dialog to make it a protected region.
The protected region shows up clearly in the timeline.
You can easily adjust the marker’s duration by dragging its handles. If you want to give the user control over the speed of the middle animation, this is not possible with Responsive Design – Time. In these cases, you can use expressions to move keyframes.
NOTE: Audio doesn’t work well with Responsive Design – Time, so don’t expect sounds you’ve synced to the animations to work in Premiere. If the user adjusts the duration of the MOGRT, the sounds will be out of sync with the animations.
Plan for error catching and feedback
Sometimes, we create features in MOGRTs that require values within a certain range. Using a slider control to adjust a value means that you can restrict it to a limited range (maximum one million). But what if you want to give users just a text field to type or paste values into—how can we make sure they don’t enter an “illegal” value?
It’s pretty common to use the parseFloat expression to convert numbers in the text to a floating-point number. It can drive the End parameter of Trim Paths on a shape layer that’s just a straight line.
So, if the user types 80 in a text field, this code will return a value of 80. If they type 25.6, the value will be 25.6, and so on.
myText = thisComp.layer("Bar 1 Value").text.sourceText;
parseFloat(myText)
The text layer is a guide layer, so it will not render. The number in the text layer controls the bar height using the parseFloat() expression.
This will work fine as long as users enter a valid number. But what if they accidentally write some text in that field instead? The expression will break, and the user will not know why.
If the user types text instead of numbers in the field, the MOGRT breaks. In After Effects, we get a warning.
In Premiere, there will be no warning. The bar height just goes to the default value, which is whatever the End parameter was set to before the expression was added. In this case, 100. This is not good!
Hidden breakage
The user fails to notice the value changing to 100 (or whatever it was before the expression was added). So they don’t know that something broke! Of course, they wouldn’t type “text” in the number field, that’s only used for clarity here. But they may accidentally type “x80”, which will also break the MOGRT.
It would be much better to detect the problem and let users know they need to enter a valid number. So nest a comp with a red solid and a warning text. And use the following code on the Opacity for that layer.
txt = parseFloat(thisComp.layer("Bar 1 Value").text.sourceText);
if (isNaN(txt)) 100; else 0;
The isNaN() part is code for is Not a Number. This will throw a big warning if the user enters text that’s not a number.
There may be other problems that are more serious than the previous one. For example, expressions that create conditions where the code tries to divide by zero are disabled. This is what try and catch(err) can be used for. Here’s the syntax structure.
try {
Block of code to try
}
catch(err) {
Block of code to handle errors
}
This method is beyond the scope of this article. But to see it in action, watch this quick tutorial on try/catch(err) from Ukramedia.com:
Some useful expressions for MOGRT designers
If you’re new to expressions, the huge number of them available can be overwhelming. But you don’t need to know all of them to make nice MOGRTs. Here’s a few that I’ve found very helpful when designing MOGRTs.
sourceRectAtTime()
This expression measures the width and height of text layers and shape layers. You can use it to make a shape layer adapt to the length of a text.
sourceRectAtTime().width
sourceRectAtTime().height
This omits the stuff inside the parentheses that you’d get from the Expression Language menu. The code inside the parentheses tells After Effects what time to measure the size and if extents should be included.
sourceRectAtTime(t = time, includeExtents = false) // full code
sourceRectAtTime(time, false) // (shorter code)
sourceRectAtTime() // (even shorter code)
Say what? Extents?
Here’s an explanation:
- For a shape layer, including extents will include strokes, repeaters, and other extra stuff, plus some room for anti-aliasing.
- A standard text layer (point text) does not have any extents.
- For a paragraph text layer, including extents will measure the bounding box. Not just the bounds of the text’s visible pixels.
Specific time
Having no text inside the parentheses will make After Effects use the current time, and extents will not be included. Sometimes, you’ll have to specify a certain time that you want to measure the text size. Say you’re scaling the text from 0 to 100 when it animates in, but you want the background box, a shape layer, to be the same size all the way and just fade in. In that case, you’d want to measure the text size after the in animation is over. If that’s at 1 second, you could use this code.
sourceRectAtTime(1)
To include extents, you’ll have to specify it in the parentheses.
sourceRectAtTime(1, true)
Here’s an example that’s often used on the Size parameter of a rectangle in a shape layer. It finds the width of a text layer named Name and adds 150 pixels to it. Then I use that for the width of the rectangle and set the height to 90 pixels.
x = thisComp.layer("Name").sourceRectAtTime().width + 150;
y = 90;
[x, y]
When the name is longer, the Name BG layer adapts. I could, of course, have linked the rectangle height to the height of the text layer too.
x = thisComp.layer("Name").sourceRectAtTime().width + 100;
y = thisComp.layer("Name").sourceRectAtTime().height + 50;
[x, y]
You can also combine this expression with Slider Controls, so the user can adjust the padding themselves. There’s a lot more we can do with this expression, like placing layers relative to the top, bottom, left or right borders of a shape or a text, and so on, but this short introduction should give you an impression of how it works.
Linear and Ease
These expressions are very useful when you need to transform values from one range to another. Say you want to give the user a slider control to control the vertical position of a logo, but the actual values that will work for the logo are between 144 and 852. That’s a strange range to give a slider.
Using the linear expression, we can transform that range into something more useful. The syntax seems a bit strange when you see it for the first time.
vPos = effect("Vertical Logo Placement")("Slider");
linear(vPos, 0, 100, 144, 852)
This expression says: “when the vPos value goes from 0 to 100, the output value should go from 144 to 852.”
You can also use it to control animation timing. This expression on the Y Position of a text layer will make it move in from the side between 0 and 0.5 seconds.
linear(time, 0, 0.5, -1000, 110)
Note that the Opacity is also animated via the linear expression, with the addition of a Duration slider. In the final version of the animation, I used ease instead of linear, to get a smoother animation, with ease into the end position. Here’s the expression on the X Position parameter.
ease(time, 0, 0.5, -1000, 110)
And here’s the code for the Opacity, which makes it fade out from 0.5 seconds before the value of the Duration slider and be completely gone at the time the Duration slider sets.
t = thisComp.layer("Controls").effect("Duration")("Slider");
linear( time, t-0.5, t, 100, 0 )
This control over time is still useful, even if we have protected regions and Responsive Design – Time. Say you want a logo to rotate around its own axis exactly three seconds after it comes in, but you want all the other animation to be controlled by the protected regions. Using an ease expression for this will make that parameter’s animation independent from the rest of the MOGRT.
Controlling the number of decimals
Math.round is great when we need whole numbers, but sometimes we want a certain number of decimals. One way to do this is to use toFixed combined with Number.
mySlider = thisComp.layer("Controls").effect("Bar 1")("Slider");
Number(mySlider).toFixed(2);
The toFixed(2) code will limit the number of output decimals to a maximum of two. The word Number at the start of the last line tells After Effects to convert the string from the toFixed expression to a number.
There’s a problem with this, though. The toFixed expression does not always round correctly! For example, values that end with .005 will be rounded down instead of up.
mySlider = 2.005;
Number(mySlider).toFixed(2); // outputs 2.00, should be 2.01
Getting exponential
One widely used solution is to use exponentials to multiply the floating-point number by some power of 10 in order to leverage Math.round. I used this approach in a MOGRT with an animated bar chart. Except that I used parseFloat (I could have used Number). In this MOGRT, one slider drives the bar heights and the numbers over the bars. A dropdown menu drives the number of decimals. Here’s the code I used to control the number of decimals. This particular one is for Bar 1.
decimals = thisComp.layer("Controls").effect("Decimals choice")("Menu");
number = thisComp.layer("Controls").effect("Value Bar 1")("Slider");
a = Math.round(parseFloat((number * Math.pow(10, decimals)).toFixed(decimals))) / Math.pow(10, decimals);
parseFloat(a).toFixed(decimals)
if/else
This is the most useful expression, in my opinion. I use it for so many different things in MOGRT design. It’s great for deciding what should happen when a Checkbox Control is ticked, when a slider is dragged, when the background color is set to blue, or when a text element has more than a certain number of characters, and so on. It’s incredibly flexible.
The if/else statement can be written in several different ways. In my opinion, the easiest one goes like this:
if (condition) value if true; else value if false
So, to control the Opacity of a layer based on the value of a menu, we could use the following code:
myMenu = thisComp.layer("Controls").effect("Color")("Menu");
if (myMenu == 3) 100; else 0
The layer would be visible only when the slider is set to 3. Here’s a way to hide or show a layer based on how a checkbox is set. The code is again used on the Opacity parameter.
myCheckbox = thisComp.layer("Controls").effect("BG on/off")("Checkbox");
if ( myCheckbox == 1 ) value; else 0
The word value means it will use whatever value the Opacity has, but only if the checkbox is on. If it’s off, the layer Opacity is set to 0.
Not limited
The if/else expression is of course not limited to the Opacity parameter. You can use it on any parameter, for example on Position to move a logo layer depending on a slider named Logo Placement.
This code on the X Position lets the user choose between different logo placements, 200 pixels from the left or right edge, with a dropdown menu named logoChoice.
if (logoChoice == 1) 200; else (1920-200)
If you’re a JavaScript expert, and know the ternary operator, this will also work.
There are more ways to compare than the double equals sign, of course. Here are the operators you can use.
Operator | Description | Example Code for Comparing |
== | equal to | If (x == 4) |
!= | not equal | If (x != 4) |
> | greater than | If (x > 4) |
< | less than | If (x < 4) |
>= | greater than or equal to | If (x >= 4) |
<= | =>less than or equal to | If (x <= 4) | =>
Combining multiple if/else expressions
Often, there are multiple conditions that should affect one parameter. In such cases, you can use else/if statements. It’s an extension of the if/else statement and the extra lines of code start with else/if instead of just else.
You start with a standard if statement, and you end with a normal else statement. All the other statements start with else if. Here’s some code from a MOGRT where I’ve used logical operators and multiple else if statements on the Position parameter to place a layer according to the value of two menus.
Pos = effect("Position")("Menu");
AR = effect("Aspect Ratio")("Menu");
if ((AR == 1) && (Pos == 1)) { [100,100] }
else if ((AR == 1) && (Pos == 2)) { [1820,100] }
else if ((AR == 1) && (Pos == 3)) { [100,980] }
else if ((AR == 1) && (Pos == 4)) { [1820,980] }
else { [960,540] }
If you know JavaScript, the Switch method could be used instead of if/else.
Making MOGRTs for stock libraries
The basic idea when building MOGRTs for sale on Adobe Stock, Motion Array, Motion Elements, Envato, and other sites that sell MOGRTs is to make the MOGRTs really flexible. You don’t know what color, font or size the user wants, so you give them lots of control.
Provide font controls
You can easily let the user choose Font, Font Size and Faux Styles. After you’ve added a Source Text to the Essential Graphics panel, click the Edit Properties button to enable these choices.
Unlimited color controls
You also don’t know what colors the user would want to use, so give them lots of freedom. On a text layer, click Animate > Fill Color > RGB to add Fill Color inside an Animator. Add this Fill Color to the Essential Graphics panel, and the user can choose any color for the text. You can do the same with Fill Color on Shape Layers and any other color parameter.
Universalize the expressions
Effects in After Effects have different names in different languages. So, if the user has a German version of Premiere Pro, a Slider will be named “Schieberegler”. If you’ve built the MOGRT in an English version, the expressions will break!
But every effect also has a universal name. To link to that name, press Alt/Option when you use the Expression Pickwhip to get the link. When I first linked to a slider in my Controls layer without pressing Alt/Option, and then again while pressing it, I got these two code snippets.
thisComp.layer("Controls").effect("ColorChoice")("Slider")
thisComp.layer("Controls").effect("ColorChoice")(1)
See how the Slider has been renamed to 1? It’s parameter number 1. The other names, “Controls” and “ColorChoice”, are names I have given the layer and the effect, so they will be named the same in every language version of After Effects—so they don’t need to be changed.
It’s so easy to forget to do this that I don’t recommend that you do it. Instead, use the Expression Universalizer script from AEScripts.com. This script will automatically universalize all your expressions, and you can do it as a last step before you export the MOGRT. Remember to do this on a copy of your project—the expressions do get harder to read.
Making custom MOGRTs for clients
When you’re building MOGRTs for clients, like organizations and companies, you do not want to give them unlimited freedom. On the contrary, all of the companies I’ve made MOGRTs for have wanted me to restrict the choices, to make sure their videos get a consistent graphic design and to keep everything within the limits of their design manual.
Get their design manual
Yes, you need their design guide, design manual, brand guidelines, or whatever they call it. It will have info about what fonts are OK to use, what colors are allowed, graphic elements that can be used, logo placement and size, and so on.
For a sample of brand guidelines, see the one from Berkeley. It’s got lots of detailed info.
Give them limited color choices
You can restrict color choices with Dropdown Menu Controls and if/else statements. The following code used on the Fill Color of a text layer or a shape layer will make sure they can’t choose an “illegal” color. Instead, they’ll choose in a dropdown menu, and the colors will change accordingly, between three legal colors.
myColor = thisComp.layer("Controls").effect("Color Choice")("Menu");
if ( myColor == 1 ) hexToRgb("003262");
else if ( myColor == 2 ) hexToRgb("FDB515");
else hexToRgb("3B7EA1")
Yes, these are three hex colors copied from Berkeley’s brand guidelines. Hex codes for colors are great because they can be copied from color swatches, typed into spreadsheets and pasted or typed into color pickers as one single code, unlike RGB colors that need three numbers. After Effects uses RGB colors, and the hexToRgb expression makes it easy to convert the hex codes to RGB values.
The hexToRgb expression enables us to copy and paste hex codes from design manuals and use them in our expressions.
Give them limited font choices
You can use a similar method if the company has two or more approved fonts. Use this code on the Source Text property of a Text layer.
myFont = thisComp.layer("Controls").effect("Font Choice")("Menu");
if ( myFont == 1 ) style.setFont("FreightSansProMedium-Regular");
else if ( myFont == 2 ) style.setFont("OpenSans");
else style.setFont("FreightSansProMedium-Regular");
To make sure that the font name is spelled correctly, complete with camelCase and hyphens, use the Expression Language Menu (the little button that looks like a Play button). Choose Text -> Font in that menu and choose the desired font in the dialog. After Effects will fill in the font name correctly.
If the company font is available from both Adobe Fonts and other sources, use the one from Adobe Fonts. This ensures that everyone can automatically sync the font if they don’t have it installed. You can choose to see only Adobe fonts when you open the drop-down menu.
Read more about using expressions to change text properties in the online help for After Effects.
Other limitations may be necessary
You will encounter a lot of different circumstances that triggers a need for limitations you never thought would be necessary. For example, the Norwegian Red Cross used to add their logo into the web video player on their website. So, editors didn’t see the logo when they’re editing, but it was there when viewers saw the video. We made it impossible to place the lower third that high when it’s on the right side. This stops lower third graphics from being placed where they get covered by the logo.
Sharing your MOGRTs with your clients
If you can be invited to their MOGRT library (a folder that can be shared between multiple editors via Creative Cloud), that will make it super easy to share the MOGRTs you’ve built for them. Just choose that library in the Export Motion Graphics Template dialog box. The MOGRT will immediately be available to everyone in the workgroup. If you need to make changes, just delete the old version and export the new one. It’s impossible for the users to accidentally grab an old version.
They can give you write permissions for a limited time, just so you can export all the MOGRTs. When everything is working OK, they can stop your access. Some customers want changes in their MOGRTs on a regular basis, and in these cases it’s probably easier if you have permanent write access to their library.
Export to Local
If you can’t get access to their Libraries, you’ll have to export to a Local Drive. Then send the files to them. Instruct them to import the MOGRTs into Premiere Pro by importing them (Graphics > Install Motion Graphics Template) or by keeping them in a folder and adding that folder to their Essential Graphics panel.
To add a folder, ask them to click on the “plus” icon in the Essential Graphics panel in Premiere Pro and navigate to the folder containing the MOGRT files.
The problem with sending the files is the person who doesn’t replace the files after receiving the new version. So there will always be a few users that need help with the process. Some will continue to use the old version.
If you can convince them to share a library with you temporarily, that’s by far the easiest method.
Learn more
I hope this article has triggered your interest for making MOGRTs for customers and for stock libraries. If you want to learn more about this topic, download the free eBook about Making MOGRTs that I wrote for Adobe. It’s 122 pages of info.
Just be aware that it was written before we got dropdown menus, media replacement, and access to all the text properties through expressions—so for some of the examples using slider controls you should rather use dropdown menus now. And instead of using multiple text layers with different fonts, your font choices can also be controlled with a dropdown menu, as shown in this article.