{"name":"Eden Editor: Layer","title":"Eden Editor: Layer","type":"topic","url":"https://community.bistudio.com/wiki/Eden_Editor:_Layer","revid":352005,"updated":"2024-02-01T23:24:02Z","aliases":[],"markdown":"A layer is like a folder that can contain multiple entities of type object, group, trigger, waypoint, system or marker.\nThey can also contain sub-layers. Layers can be useful in various ways such as:\n\n- Tidying up the editor view while editing by hiding the layers and their entities\n- Grouping certain entities together thematically\n- Preventing a group of entities from being accidentally edited by disabling transformation\n- Dynamically creating the entities within a layer during the scenario\n\n### Creating a layer\n\nThere multiple ways to create layers:\n\n1. Select entities in the 3D or map view or the entity list (left panel) and press the *New Layer* button in the entity list\n1. Use the add3DENLayer scripting command\n\n> [!NOTE]\n> Pressing the *New Layer* button without having entities selected will create an empty layer\n\n### Deleting a layer\n\nLayers can be deleted by either selecting them in the entity list and pressing the <kbd>Del</kbd> key or using the *Delete* button in the entity list.\n\n> [!IMPORTANT]\n> Deleting a layer will also delete all sub-layers and entities within it!\n\n### Dynamically create layer entities\n\nOne advantage of layers is that they can be used to hide or show all entities within the layer dynamically via scripting during a scenario.\n\n1. Create a layer, name it *NewAO* and add some objects and markers to it.\n1. Select all objects in that layer and uncheck *Show Model* and *Enable Simulation* in the attributes. In case of markers, set the *Alpha* value to `0`\n1. Preview the scenario\n1. All objects and markers will now be invisible\n1. Open the Arma 3: Debug Console and execute the following code. If you use want to activate the layer via a trigger, make sure to check the *Server only* checkbox\n\n   ```sqf\n   getMissionLayerEntities \"NewAO\" params [\"_objects\", \"_markers\"]; // The command returns an array with two arrays. First array contains all objects, second array contains all makers\n   _markers apply { _x setMarkerAlpha 1; }; // Show all markers\n   _objects apply { _x enableSimulationGlobal true; _x hideObjectGlobal false; }; // Show all entities and enable their simulation\n   ```\n\n### Attributes\n\n| Info |  |  | Development |  |\n|---|---|---|---|---|\n| Name | Category | Description | Property | Type |\n| **Name** | Init | Name of the layer set in Eden Editor | `Name` | String |\n| **Enable Transformation** | Init | If set to false (unchecked), the layer cannot be modified inside Eden Editor. | `Transformation` | Boolean |\n| **Enable Visibility** | Init | If set to false (unchecked), the layer will not be shown inside Eden Editor. This **will not** affect visibility during the scenario! | `Visibility` | Boolean |","sections":[{"heading":null,"level":1,"markdown":"A layer is like a folder that can contain multiple entities of type object, group, trigger, waypoint, system or marker.\nThey can also contain sub-layers. Layers can be useful in various ways such as:\n\n- Tidying up the editor view while editing by hiding the layers and their entities\n- Grouping certain entities together thematically\n- Preventing a group of entities from being accidentally edited by disabling transformation\n- Dynamically creating the entities within a layer during the scenario"},{"heading":"Creating a layer","level":3,"markdown":"There multiple ways to create layers:\n\n1. Select entities in the 3D or map view or the entity list (left panel) and press the *New Layer* button in the entity list\n1. Use the add3DENLayer scripting command\n\n> [!NOTE]\n> Pressing the *New Layer* button without having entities selected will create an empty layer"},{"heading":"Deleting a layer","level":3,"markdown":"Layers can be deleted by either selecting them in the entity list and pressing the <kbd>Del</kbd> key or using the *Delete* button in the entity list.\n\n> [!IMPORTANT]\n> Deleting a layer will also delete all sub-layers and entities within it!"},{"heading":"Dynamically create layer entities","level":3,"markdown":"One advantage of layers is that they can be used to hide or show all entities within the layer dynamically via scripting during a scenario.\n\n1. Create a layer, name it *NewAO* and add some objects and markers to it.\n1. Select all objects in that layer and uncheck *Show Model* and *Enable Simulation* in the attributes. In case of markers, set the *Alpha* value to `0`\n1. Preview the scenario\n1. All objects and markers will now be invisible\n1. Open the Arma 3: Debug Console and execute the following code. If you use want to activate the layer via a trigger, make sure to check the *Server only* checkbox\n\n   ```sqf\n   getMissionLayerEntities \"NewAO\" params [\"_objects\", \"_markers\"]; // The command returns an array with two arrays. First array contains all objects, second array contains all makers\n   _markers apply { _x setMarkerAlpha 1; }; // Show all markers\n   _objects apply { _x enableSimulationGlobal true; _x hideObjectGlobal false; }; // Show all entities and enable their simulation\n   ```"},{"heading":"Attributes","level":3,"markdown":"| Info |  |  | Development |  |\n|---|---|---|---|---|\n| Name | Category | Description | Property | Type |\n| **Name** | Init | Name of the layer set in Eden Editor | `Name` | String |\n| **Enable Transformation** | Init | If set to false (unchecked), the layer cannot be modified inside Eden Editor. | `Transformation` | Boolean |\n| **Enable Visibility** | Init | If set to false (unchecked), the layer will not be shown inside Eden Editor. This **will not** affect visibility during the scenario! | `Visibility` | Boolean |"}],"categories":["Eden Editor: Asset Types"],"groups":["Mission Editing"]}