O Layer, what size art thou?

One of the more unique aspects of Motion is flexibility of the layer system. Layers act as containers, holding other objects, such as images, text, and even other layers. While layers are primarily containers, they do have all the same standard properties as other objects in Motion: size, position, crop, drop shadow, etc. Most interesting, though, is that layers (by default) automatically size themselves to the union of their children.

Take a look at the example below: our layer contains two ball images (fig. d). If we select the layer, we can see its boundaries, which are the union of both ball images (fig. e). If we move the balls around and re-select the layer, we see that its size has changed to reflect the new object positions (fig. f).


fig. dfig. efig. f

What does this automagic resizing get us? How does it help you? Well, it certainly takes the guesswork out of having to manually specify the size of each layer, as you have to do in other programs. It's such an immediate and obvious benefit, that many users don't even know it's there.

Take, for example, a particle system: in Motion, I can play with the particles as much as I like, adjusting speed, lifetime, adding simulation behaviors like gravity...and I never have to resize the layer holding the particles. It always sizes itself so that I can see all the particles, without clipping.


fig. g

Another benefit is that filters that cause the image to grow can communicate with the layer, telling it to expand, as needed.

If you look at fig. g, you can see that I've applied a Light Rays filter to the layer, and the layer has grown, allowing the glow to expand beyond the layer's original bounds, shown in red. No extra step was needed to adjust the layer's size: it's all automatic.

But what if I didn't want my layers to auto-size themselves? What if I wanted to set them to a precise size, and have them stay there?

For example, let's say that I have a particle system that shoots particles out from the center of the canvas. I then want to apply a filter to the particles, but since some of the particles fly offscreen before dying, I'm filtering an image that is larger than necessary, which, as we learned before, is inefficient. There's another catch, as well: some filters have parameters with coordinates, like the centerpoint of the Light Rays filter, and those coordinates are relative to the size of the object the filter is applied to, so if that object is constantly changing size, those coordinates change, too.

Here's a movie that shows a particle system with the Light Rays filter applied to it. As you can see, as particles are born, move off, and die, the size of the particle object is constantly in flux. This causes the centerpoint of the filter (the little circle with the cross-hairs in it) to jump around, making consistency impossible. In this small, abstract example, the jiggliness of the glow isn't so obvious, but imagine the effects this problem could have on a larger project.

Applying the filter to the parent layer doesn't solve the problem, because the layer is auto-sizing itself to fit the particles. If only there was a way to achieve...

Fixed resolution!

It doesn't have a cool name like "flux capacitor" or "oscillation overthruster", but the Fixed Resolution feature is your new secret weapon. It's not glamorous, but it allows you to have the best of both worlds: Motion-style flexible layers and After Effects-style layer pre-comps.

Let me be clear: Motion has only one kind of layer. But that layer can behave in a couple of different ways: the default behavior, which I will term 'automagic', and the Fixed Resolution behavior.

The automagic layer behavior we covered in the previous section: it auto-sizes, allows blend modes to pass through, and allows vector objects to scale as needed (see sidebar).

A pre-comped layer is just that: pre-composed. This means that the layer's contents have been combined into a single image before anything else happens to the layer, such as transforms, filters or behaviors. A layer gets pre-comped by changing its blend mode to anything other than the default (Combine). You can manually set the blend mode to non-Combine, but applying a filter or enabling Fixed Resolution will do it automatically.

Enabling Fixed Resolution for a layer causes the blend mode to leave Combine and it fixes the layer to a specified size. It sets the full size of the layer, in pixels, and then properties like Scale and Crop affect it afterwards. Basically, the layer is now treated as if it were a pre-rendered Quicktime movie: it will no longer auto-size itself to its children.

What does this gain us? Well, for one, it alleviates the afore-mentioned problem with the Light Rays filter on the particles, because you can enable Fixed Resolution for the parent layer, locking down the size, then apply the Light Rays filter to the parent layer. Since the layer no longer randomly changes size, the filter's centerpoint stays in place.

Consider a simple pan/scan case: you have an image that is larger than your project, and you're panning it across the project area. Applying a filter to the whole image is wasteful, because you can't even see the whole thing. The more efficient choice would be to filter the parent layer, but if it's auto-sized it's just as big as the image. But if you turn on Fixed Resolution for the layer, the layer will be cut off at 720x480 (it defaults to the project size), so you can filter it without regret.

Or what if you wanted to apply a Border filter, like Widescreen, to your project? You'd simply apply the filter to the top-most layer, and your project would have a nice letter-boxed look, right? With Fixed Resolution disabled, your layer would be larger than the project area and changing in size, so the black bars from the Widescreen filter would be moving around or even entirely off-screen. With Fixed Res enabled, the layer snaps to the project size and the filter applies beautifully.

Protecting your GPU's sanity

In situations where your GPU has hit its limit, Fixed Resolution can allow you to have more control over what Motion is trying to process, allowing you to sidestep some rendering landmines.



Take this example: you have a DV-sized project with three DV clips, A, B and C.

Clip A acts as a background, and clips B and C are going to fly on- and off-camera, from left to right. At the moment that image B finishes its move, you have a layer that is more than three DV images wide, greater than the 2K limit of your GPU. This is no biggie, though, as the layer isn't pre-comped, so it's treated as a group of smaller objects, instead of one giant image.

Then you decide that you want to apply a Sepia filter to the layer, color-correcting all three clips at the same time. But as soon as you apply that filter, the layer gets pre-comped, and at the widest point, when clip B reaches the right-side of the screen, the layer exceeds the 2K limit, resulting in a crop. Since the crop isn't centered, the image seems to slide to the right, partially revealing the previously-off-camera clip C.

If you were to enable Fixed Resolution for the layer, though, its size would stay consistently at the project size, resulting in a pre-comp that is well within the 2K limit of your GPU, preventing any cropping.

As you can see, having an understanding of Motion's Fixed Resolution feature is key to project optimization and avoiding GPU texture limit problems. A couple of tutorials that take advantage of it can be found here (Glowy) and here (Supertext).

Good luck, and don't forget to have fun!