[Solved] Condition to check a layer existence

Hi,
I’m wondering if there is a condition to check by its name if a layer exists or not.

Or is there a common characteristic shared by existing layers that I can use as a condition to check if they exist or not? Like maybe their default z order?

I’d need such a condition for a quick loop among my “Layer1”, “Layer2”, …, “Layern”, to get my number of layers, n. It may sound stupid but it’d help me a bit, and such a condition should exist…?

Unfortunately, there are not any events to interact with layers besides the following:

Actions:
Show a layer
Hide a layer
Enable/Disable layer effect
Compare default Z order on layer.

Conditions:
Is layer visible?
Is layer effect enabled/disabled?
Change default Z order on layer.

There is not currently a way to loop through layers that exist, since you cannot create layers via events, the event system expects you to know what layers are there currently.

1 Like

Thank you for your reply. It made me think of something that works.

There is a way to check the existence of a layer: show it (action) and they check its visibility (condition). If still hidden, it doesn’t exist.

I can loop them cause their names in my project are “Layer1”, “Layer2”, etc.

So problem solved :slight_smile: