Alignment & Grouping only vertically centers to the top-most layer.
-
I’m having a lot of trouble with Templater’s alignment / grouping.
Even when I group layers by cap, middle, and base, templater always seems to vertically align all layers by the position of the top-most layer. Padding also seems to be having zero effect.
In the screenshot I added a solid read line to show where templater is aligning my two layers, and a dotted red line to show where it should relatively be centered.
I have also toggled off and on all combinations of consider anchor point and that doesn’t seem to do anything either.
-
Thanks for getting in touch with us. It’s possible that we might need to get a more complete screenshot of the project, but from what I can see here, it appears that the Templater Alignment and Attachment settings are functioning normally.
This could be because I’m not seeing the whole project, but it seems as though the “Icon1” layer is being centered in the project window, and “Explanation1” is being attached to the bottom of that layer with 40 pixels of padding, as shown in the Effects Control panel.
Again, I could be incorrect, but I’m basing this on the “X” watermark that we can see on what I’m assuming is the “Media1” layer. This watermark shows us where the center point of the project would be, which seems to coincide with the center point of the “Icon1” layer.
Again, I might be missing something due to the constraints of the screenshot, so if that’s the case, we’ll likely need to see a larger version so we can get a better handle on all the variables at play in the Alignment/Attachment Settings.
If you don’t feel comfortable sharing a complete screenshot here, please feel free to contact us directly at support@dataclay.com. Hopefully, with a bit more detail, we can help you resolve this issue.
Thanks,
Jeff
-
Hi Jeff,
What I’m trying to do is get the icon and the text to center as a group instead of centering just the icon and attaching the text on the bottom.
So say I had 6 lines of text instead of the 2 that you see in the screenshot. If the icon and the text were centered as a group everything would be shifted up because of the increased size of the text.
Currently if the amount text increases it will have zero affect on the overall position of the icon and the text position because the icon is what is being centered, not the group.
Also, if you look closely at the bounding box of the icon, you can see that it is quite a bit bigger than the actual icon. So assuming a 40px padding the text should be way below its current position.
-
Ah, OK. I see now. Unfortunately, Templater can’t really group layers together when it comes to the Alignment properties. To achieve what you’re describing, we’ll need to consider some alternate methods for how to reposition those layers appropriately.
My first suggestion would be to pre-compose the two layers together and then use Templater’s Alignment options to center the pre-comp. This likely wouldn’t be optimal since the amount of text will be changing fairly dramatically, but I thought I’d throw it out there since many positioning issues can be quickly solved by combining the stability of a pre-comp with the dynamic layout options available in Templater.
The next option would be to use a third-party plugin to take care of the alignment rather than Templater’s own layout engine. We recently added an option in the Templater Preferences Panel that reads “Use Templater’s” with options for “Layout engine” and “Time Sculpting”. The logic here was that an end user could disable Templater’s internal Layout engine and use a separate third-party plugin like Pins and Boxes or Flex to govern the layout principles for the project. I don’t believe this would be the ideal solution for this particular issue, but I wanted to point it out in case it was helpful.
I believe the optimal solution for this scenario would be to use an After Effects Expression rather than the Templater layout rules to govern the position of the layers. This can be a bit complicated since we’ll need to take into account several different factors, but once implemented, I believe it will be the best option for what you’re trying to achieve.
For this example, I’m going to assume that we have two layers, a PNG and a text layer. The layer names will be “PNG” and “text,” just to keep things simple. If you end up using these Expressions, you’ll need to change the variable names to reflect the layer names in the project. To start, we’ll want to add this Expression:
a = thisComp.layer("PNG").sourceRectAtTime(); height = a.height; width = a.width; top = a.top; left = a.left; x = left + width/2; y = top; [x,y];
To the “Anchor Point” property of the PNG layer. This Expression should automatically adjust the Anchor Point to the top center of the PNG layer, which will be necessary to position it correctly during the next step. From here, we’ll want to add this Expression:
var1 = thisComp.layer("PNG").sourceRectAtTime().height * (thisComp.layer("PNG").transform.scale[0] * 0.01); var2 = thisComp.layer("text").sourceRectAtTime().height * (thisComp.layer("text").transform.scale[0] * 0.01); var3 = thisComp.layer("text").effect("Templater Settings")("Attach padding"); totalHeight = (thisComp.height - (var1 + var2 + var3)) / 2; [transform.position[0], totalHeight];
To the “Position” Property of the PNG layer. This Expression should get the raw height of both the PNG and text layers and then multiply them by the “Scale” property to get the actual size of each layer. It will then get the padding value from the text layer. Finally, it will add all of those values together, subtract them from the total height of the comp, and then divide the result by two. This should give us equal padding on the top and bottom once the Expression completes its calculations. We’ll need to change the names of the layers on var 1, 2, and 3 to match the layers in your project, but this technique should center align the two layers the way you described.
Hopefully, that gets us moving in the right direction, but if you have any questions about any of this, please feel free to let us know.
Thanks,
Jeff
-
@Jeff That is awesome! Thank you!
Worked like a charm