mapeditor / mapeditor/tiled

Scripting: batch add/remove layers

Open
#3,329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

**Is your feature request related to a problem? Please describe.**
I maintain a script that frequently adds/removes all layers on a map. At this time I have to call addLayer() and removeLayer() for each individual layer. For large maps this can be noticeably slow.

**Describe the solution you'd like**
I would like an addLayers(layers: Layer[]) function that takes an array of Layer[] to be added to the map.

I would also like a removeLayers() function that removes all layers, and a removeLayersAt(from: number, to: number) function that removes the layers between the provided indices.

**Describe alternatives you've considered**
No alternatives possible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the scripting entry points for addLayer() and removeLayer(). Review how individual layer operations are exposed, then determine the expected behavior for addLayers(layers), removeLayers(), and removeLayersAt(from, to), including index boundaries. Done means all three batch operations are available through scripting and match the requested layer behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.