Highlighted

Can I turn off shape layers by expression - to minimize CPU load?

Community Beginner ,
Jun 22, 2020

Copy link to clipboard

Copied

Hi

 

I'm handling a world map into a rig - each country is a shape layer. That is a lot of vectors to move around. But most of the time, I'm zoomed into and only interested in specific parts of the world - and I would be ideal if I could turn off all the shape layers (countries) outside of the screen - for a faster rendering. Is this possible in some way? Would turning the opacity down to 0 do the trick, or will it still compute the shapes? Is there another way?

 

 

TOPICS
Expressions, How to, Performance, Scripting

Views

114

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

Can I turn off shape layers by expression - to minimize CPU load?

Community Beginner ,
Jun 22, 2020

Copy link to clipboard

Copied

Hi

 

I'm handling a world map into a rig - each country is a shape layer. That is a lot of vectors to move around. But most of the time, I'm zoomed into and only interested in specific parts of the world - and I would be ideal if I could turn off all the shape layers (countries) outside of the screen - for a faster rendering. Is this possible in some way? Would turning the opacity down to 0 do the trick, or will it still compute the shapes? Is there another way?

 

 

TOPICS
Expressions, How to, Performance, Scripting

Views

115

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
Jun 22, 2020 0
Most Valuable Participant ,
Jun 22, 2020

Copy link to clipboard

Copied

That makes zero sense for a million reasons. First, AE is a full-buffer renderer to begin with, so regardless where you are zoomed in, the whole contents of the comp are evaluated. Second, dynamically rasterized layers like shape layers have their own quirky logic, where also the content of the whole layer is computed in relation to the comp-sized container. and third and final of course expressions take computing power, too, and given how AE works evaluate on every frame. So if you were to apply tons of expressions to individual elements, the calculations for the expressions would far outweigh any performance degradation caused by the vector raster engine itself and even jumping to the next frame would take forever. So no, this will not do anything. If you really want to optimize the workflow, you have to actually hide the layers by turning off their visibility. If it's a regular requirement for a large number of layers, you might want to find a script that can do this in bulk like Zorro the Layer Tagger based on applying specific named markers.

 

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...
Jun 22, 2020 0
Community Beginner ,
Jun 22, 2020

Copy link to clipboard

Copied

Thank you Mylenium. Yeah, I didn't think turning down the opacity would work either. 😉

And turning off layers visibility actally do make a difference - but I can't acces that in Expressions - as far as I know. But I understand from your answer that there might be some script way? I will google Zorro the Layer Tagger to see if it'll work. Thanks again.

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...
Jun 22, 2020 0
Most Valuable Participant ,
Jun 22, 2020

Copy link to clipboard

Copied

Just check AEScripts.com. There is any number of layer and shape related script. perhaps you're stumble upon something that solves your issue perfectly.

 

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...
Jun 22, 2020 0
Adobe Community Professional ,
Jun 22, 2020

Copy link to clipboard

Copied

Not 100% sure but I think Ae already has an optimization that layers which are outside the comp are not rendered at all. Can any Adobe staff comment on that?

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...
Jun 22, 2020 0
Most Valuable Participant ,
Jun 22, 2020

Copy link to clipboard

Copied

Correct. AE will and always has optimized layers that don't produce any visible pixels, meaning they are fully outside the comp, have 0 opacity, aren't referenced in any effects and a few other scenarios. It used to work more relaibly in the past, though, as apparently these days there's too many "evil" combinations of settings and features that could override the behavior.

 

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...
Jun 22, 2020 0
Adobe Community Professional ,
Jun 22, 2020

Copy link to clipboard

Copied

Opacity still needs to be calculated even if it is zero so setting opacity of a layer to zero has very little if any effect on the calculations.

 

Continuously Rasterize expands the edges of nested (pre-composed) 3D layers but, as Mylenium and Mathias both said, AE does not calculate pixels that fall outside the frame with the possible exception of particle lifetime if particles fall off the screen. The only thing that excludes a layer in the frame from the processing load is an in or out point. If a layer boundary is still in the frame but you don't want to see the layer anymore, set an out point. I do this all the time when animating opacity. If the opacity goes to zero and that's the last opacity keyframe I always set an outpoint for the layer. 

 

Other than that, optimizing the original artwork and breaking a long comp up into manageable sections is the best way I know of to reduce the processing load and make AE more efficient. 

 

If you created your world map in Illustrator or used stock vector art, then imported the file as a comp retaining layer size, then converted all of the vector layers to shapes the comp is going to be a lot slower to work with. AI (vector layers) are a lot faster to work with and the UI is going to work a lot better if you do not convert them to shape layers. The only practical reason to ever convert a vector layer to a shape layer is if you need shape layer animators like Trim Paths, or you need to animate the path shapes. If you need to extrude layers using the C4D rendering engine you will have to convert vector layers (Illustrator files) into shapes, but there are better options for extruding shapes than using the C4D rendering engine built right into AE.

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...
Jun 22, 2020 1
Community Beginner ,
Jun 22, 2020

Copy link to clipboard

Copied

Hi Rick Gerard

 

Thanks for your thorough answer. 

 

Interesting that AI vectors work better than AE vectors. I did convert all of them - I thought they would be optimized - but also because I needed to rig all the fills and strokes to colors.

 

I will try the outpoint solution - but is this available as an expression?

 

 

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...
Jun 22, 2020 0