Select/draw/del/C&P in multiple layers
Hi, a little request: It'll be awesome if you could select multiple layers and work with all at the same. For example:
You select 3 layers, then make a tile selection, copy and paste. Each tile could be drawed on the same layer name, or maybe on the current selected layers, respecting the same order (or something like that).
I usually have zones drawed in 3/4 layers that I want to repeat in the map, and I have to C/P each layer.
Thank you very much, and sorry for my english :) (I don't know if this is the right place for doing requests, if not, delete it ;)
I fully agree Tiled needs this feature, but I'm unsure how to best implement it. Problem areas:
- If we match by layer index, the target map might not have these indexes or it might have different kinds of layers at these indexes.
- If we match by layer name, the target map might not have layers with the same name, it might have multiple layers with those names and it might have layers with the same name but that are of a different kind.
- If we require the user to select the target layers, I reckon the whole process will feel quite clumsy. And, what if the user pastes before doing this selection, or what if his selection does not match with the copied layer count, or selected layers are of different kinds?
- Currently pasting puts the copied part in the stamp brush, so you can then place it where you want. In order to do multi-layer paste, we either need to change this approach or make the stamp brush deal with a multi-layer stamp somehow.
- How to deal with copy & paste when it involves different kinds of selected layers? (also regarding the use of the stamp brush in case of tile selection)
Also, once #149 is implemented, tile layer selection can't even be reliably applied to all tile layers anymore. Not sure how to solve that yet either.
(I've read your last comment while writing, I comment it at the end)
I have been thinking about the best solution, and I have this possibility:
- Layer match by layer order.
- Independently of the layer index / name. If you copy from layers 1, 3 and 5. Then select layers 3, 6 and 9 and paste, layer 1 selection will be pasted on layer 3, 3 on 6 and 5 on 9.
- That's not a big problem, commonly you will copy and paste from and to the same layers (e.g to move or to clone a building). And if not, you have to select the new layers (normal), and the tiles will be pasted respecting the same order (so the result will be the same, but on other layers).
- origin_layers < destination_layers = paste in order and ignore last destination_layers, the tiles will be pasted only on the first X layers.
- origin_layers > destination_layers = ignore last origin_layers. If you've copied 4 layers, you select only 2 and paste, only the first 2 layers will be pasted. If you make a mistake, you will see easily that the result is not "complete" and you need to select more layers.
- Layer type, ignore non tile layers when pasting.
- Updating the stamp brush would be incredible. However, if it is complicated, when copying more than 1 layer, the stamp brush wont show the "result". You will see the effect when pasting. If you are not happy, ctrl Z and repeat :)
- Regarding your last comment about issue #149 :
- I really don't know if you are working on that, but it is a very good feature.
- The easiest solution is not to permit selection when the layers have <> types/tile_size. A good way for selecting layers could be pressing ctrl + clicking on the layers. Once you have selected the first layer, if you move the cursor to a layer with <> type, a little "x" or a message could appear beside the cursor while pressing ctrl. You can't select this layer. When pasting, the process will be the same as above. Respecting the order, and ignoring <> layers (type, size, etc.)
I'm not a good coder, so it's nearly impossible for me to implement it. My only help could be to test, to help with design and donate some $
Its my personal experience that donating some $ gives bjorn great motivation to work on requests (so please donate if you can, this is a great program for the game development community). However, this is quite a big request and might take a while to complete. This would be a great addition to the program, and as a fellow tiled user, I thank you for your suggestions :)
Could you have a mode where you highlight a section and you can then drag it to a new place in the map, and have it affect all layers within the highlight region? You could also rotate the selection. This alone would make working on maps a lot easier and save a lot of time.
I really would like this feature. I have fairly complex trees in my scene, which end up being 4 or 5 layers deep. The only way to copy and paste trees around the map is to do it 5 times for every single tree. It's just not feasible. In my use case, most of the issues mentioned are not issues, as I am never copying from one map to another - only copying tiles I've drawn within a single map; and I never care about copying tiles and objects at the same time. The stamp brush is the only complex piece in that case.
No offense intended (thanks for the years of effort!), but it is sometimes sad to see features put on the back burner because doing them perfectly is difficult; when doing the most basic or imperfect version of the feature is actually 80% of what people want.
is this possible to make copy/paste of all layers within one document? in this case should not be any problem. if user removed or add new layer, just show notification that selection in buffer would lost.
@nicloay While this would avoid some of the issues, it does not make this an easy task since the stamp brush still needs to be adapted to handle multiple layers. It would also introduce a parallel copy/paste system which I'm not too fond of.
In general this is an issue I'd like to address, but I have to choose my priorities somehow. Due to the limited time I've had for Tiled development over the past two years, my priorities have been driven mainly by pull requests and sponsored features. And this feature is something nobody set out to address nor did anybody offer to pay for it. I hope that based on support via Patreon, I will soon be able to spend one full day per week on Tiled which would make time available for working on issues like these.
Just wanted to echo the sentiments of others here. Being able to select multiple layers, dragging out a box and then being able to either move or copy the selection would be so helpful.
This would be extremely helpful when creating automapping rules.
Pretty much the biggest thing that could be done to improve workflow/quality of maps.
I also think it would be the greatest improvement to the usability of tiled currently. Regarding the best way to do it, why not have a button to select from all layers? Then the copy/paste would not have to be any different (at least from the user point of view). Then for pasting, there could be 2 ways to handle it: a) The tiles could be copied with their index and offset to the current layer, and pasting them would paste to the layer given by currentlayer+offset.
b) The tiles would be copied with their index and the layer name, and when pasting each selected tile would be pasted into the layer of the same name at the current location. If it does not exist (because it is another map), then a layer of the same name is created.
a) is more consistent with the current system b) is more useful I think any of the two can work.
Bjorn, how is this coming along? Do we need a bounty to move up the priority (if so, how much is needed given scope of work?). If more than I can pony up, I'll try to organize a pool.
@Bobjt Even with spending two full days on Tiled, I'm totally swamped by all kinds of things. I think currently this is mostly because of the Google Summer of Code mentoring, and of course there's the time spent on documentation recently (moving to a more powerful format and to enable translations). Other problems are that major patrons have asked me to spend time on things like loading resources from URLs and soon showing adjacent maps in the same view.
So, of course it's an option to collect up to $200/month, at which point I will promise to commit at least a full day/month to the issue until it is resolved. When things calm down I will eventually get around to it, but I can't promise a timeline.
Scope-wise, I think this feature opens op a big can of worms, so a rough estimate would be 2-4 days of work.
Thanks for the follow up and I've adjusted contribution. Though not sure how long I can maintain gold level, I rely on Tiled heavily and so there are few hesitations with chipping in commensurate to my investment in my own title. Now worries if it takes a while. I might drop down and come back later to try again depending on finances availability. Either way, I'll be around cheering from the sideline.👍 Keep up the good work.
@Bobjt A major thanks for increasing your support so dramatically! Unfortunately for this month I don't have a day available anymore, but that means I'll be looking for 2 days in August to focus on this issue. I've mentioned this issue in the latest development update. Thanks for the encouragement as well!
Started work on this today, but made slow progress so far. There is a new branch wip/multi-layer, where I've enabled multi-selection in the Layers view (5b3b1991b44ddab483cfd67aa50747886fb14713). In coming days I will see how this will affect various actions, especially painting and selection, but also grouping or moving up/down multiple layers for example.
So excited, Bjørn. While milling away in Tiled as many hours of the day as possible, I've been watching the lists for status. Really looking forward to this one. Cheers!
@Bobjt I'm quite excited about improving this area of Tiled myself as well. Thanks again for your support and sorry for the delay in getting to this!
I've posted a demonstration based on the above commit on YouTube:
https://www.youtube.com/watch?v=pu-yShBRCqM
Unfortunately I have committed to a few other improvements as well, but I aim to get back to working on this in the next weeks.