Highlighted

Expression to refit solids, masks, etc when comp resizes

Community Beginner ,
Oct 31, 2020

Copy link to clipboard

Copied

I have a comp that I need to keep resizing to fit various social media standards, and would like, for instance, a vignette to resize automatically each time.

In the example of the vignette, it is a solid with a full-scale ellipse appled.

 

I see in general how to use the comp size in an expression via thisComp.height and thisComp.width, but I'm not seeing how to apply that to a solid contained within the comp because it's width and height aren't in the attributes that dorp down below it, so not sure how I would refer to them, or where that expression would be entered.

 

Similarly, for a vignette created by feathered eliptical mask, the mask does have visible size (as opposed to scale) attributes, but they are in a popup when I click "shape" next to the "Mask Path" attribute.  Essentially, the size is determined by the distance between the left and right values, and top and bottom values.  Even if I assume left and top values are zero, so the bottom and right values match the comp size, not sure how to refer to them, or where that expression would go.

 

Also open to any other method that achieves simalar end of resizing solids, sapes, etc such that they resize to fit the new comp dimensions.

TOPICS
Expressions

Views

89

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Expression to refit solids, masks, etc when comp resizes

Community Beginner ,
Oct 31, 2020

Copy link to clipboard

Copied

I have a comp that I need to keep resizing to fit various social media standards, and would like, for instance, a vignette to resize automatically each time.

In the example of the vignette, it is a solid with a full-scale ellipse appled.

 

I see in general how to use the comp size in an expression via thisComp.height and thisComp.width, but I'm not seeing how to apply that to a solid contained within the comp because it's width and height aren't in the attributes that dorp down below it, so not sure how I would refer to them, or where that expression would be entered.

 

Similarly, for a vignette created by feathered eliptical mask, the mask does have visible size (as opposed to scale) attributes, but they are in a popup when I click "shape" next to the "Mask Path" attribute.  Essentially, the size is determined by the distance between the left and right values, and top and bottom values.  Even if I assume left and top values are zero, so the bottom and right values match the comp size, not sure how to refer to them, or where that expression would go.

 

Also open to any other method that achieves simalar end of resizing solids, sapes, etc such that they resize to fit the new comp dimensions.

TOPICS
Expressions

Views

90

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 31, 2020 0
Most Valuable Participant ,
Nov 01, 2020

Copy link to clipboard

Copied

Expressions can't control source item attributes and some other things and that is that. The rest simply sounds like you're making this unnecessarily complicated. If you really want or need to make dynamic vignettes, using the good old Circle and Ellipse effects combined with blurs will do just fine and actually have properties that can be rigged. Similarly, a lot of stuff can be aligned by simply using the Transform and Motion Tile effects without ever having to tweak the base transform properties. Of course masks and shape paths can also be rigged with expressions ever since AE 2015. Just read the online help on teh subject. However, why should anyone put up with any of this? Why not simply design a bunch of standard compositions with the most common sizes and have all the lements ready inside them in such a form that they can easily be substituted by ways of pre-compositions? Again, I think you are approaching this wrongly. Sure, you may not be able to cover all bases, but at this point there are enough standardized banner sizes that sufficiently fit many scenarios, so it would be easy enough to have a sqaure comp, a classic 4:3 fullscreen comp, a skinny horizontal banner comp, a tall comp and so on. Most of the services in question also have the exact measurements documented in their FAQ/ Support sections and you should have no issues whatsoever preparing for that.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2020 0
Greg5CD6 LATEST
Community Beginner ,
Nov 03, 2020

Copy link to clipboard

Copied

Points taken.  I'm looking at this on a longer arc, though.  I'm not creating a single project in multiple aspects so much as trying to create a single template that will then be adapted to a variety of projects, and there are quite a few output shapes as I'm also using it to generate stills for various banners, etc.  Probably over a dozen output shapes in all.

 

Just came across the Smart Resize plugin which looks like it may be what I'm looking for as it essentially creates presets for how things should be rearranged and resized or partially resized depending on the aspect and other factors like what portion of the given output is visible on mobile vs desktop, etc.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 03, 2020 0
Explorer ,
Nov 02, 2020

Copy link to clipboard

Copied

There are some Scripts pre-bundled with After Effects like Scale Composition.jsx

If that does not do the trick for you - you might modify a copy of the script and do some additional scaling to specific properties of your layers.

 

Check https://aenhancers.com or https://aescripts.com/after-effects/automation/template/ for existing Scripts.

And https://ae-scripting.docsforadobe.dev/ for a good reference guide on scripting for After Effects yourself.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0
Community Beginner ,
Nov 02, 2020

Copy link to clipboard

Copied

It's a bit more complex in than scale composition in that various bits need to be scaled in different ways to really be able to effectively go from very tall to very wide orientations.

Good info, though.  Will dig in a bit more when I've got some time to do so.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 1
Adobe Community Professional ,
Nov 02, 2020

Copy link to clipboard

Copied

Much easier to use a Shape Layer's Size property with thisComp.width/height. The issue comes with the Mask and it really depends how you want the mask to responds to a change in the comp's aspect ratio. To simplify matters, you may use a second Shape Layer as a matte. If you intend to do everything on a single Shape Layer with a feathered mask then I suggest you look into using the Create Null from Paths feature. BUt do take note that you will still have to decide how you want to deal with each comp's aspect ratio. You then, use an array from which an Expression will capture the appropriate array index that is suited for the comp size/aspect ratio. HTH

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0
Community Beginner ,
Nov 02, 2020

Copy link to clipboard

Copied

All the masks need feathering, but hadn't heard of Create Null from Paths, so will look into.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2020 0