Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bulk Export Tilesets #1161

Open
chasecromwell opened this issue Dec 25, 2015 · 7 comments
Open

Bulk Export Tilesets #1161

chasecromwell opened this issue Dec 25, 2015 · 7 comments
Labels
feature It's a feature, not a bug.

Comments

@chasecromwell
Copy link

It would be really nice to export all of the tilesets I have open to a file so I can import all of them every time I need to use them with a new map.

@bjorn
Copy link
Member

bjorn commented Dec 26, 2015

Do you mean to save them to some kind of "tileset collection" file?

@chasecromwell
Copy link
Author

Exactly.

@bjorn
Copy link
Member

bjorn commented Dec 28, 2015

While I agree this would be useful, the difficulty with this is figuring out how Tiled should deal with changes to tilesets that are part of such a collection (regarding undo stack, for example), as well as how to manage such a collection (like adding/removing tilesets).

Also, I think the reason why you need this feature is only because you need to manage the set of tilesets used by every map explicitly. I'd personally much prefer if you could manage the tilesets once on a project level, and then Tiled should figure out which tileset is used by each map automatically. I think such a thing would be easier if all tilesets were external tilesets.

@bjorn bjorn added the feature It's a feature, not a bug. label Dec 28, 2015
@RokKos
Copy link

RokKos commented Mar 19, 2018

Hey,
first of all, I really enjoy using Tiled it makes my everyday job so much easier.

I just wanted to ask is this still a feature to be implemented?
If it is I could it be implemented in such way that Tiled detects which files you have opened and just export them in the chosen format like JSON or CSV.

Because I have not setup python script that goes through the whole folder and manipulates all the JSON files and then saves all the JSON files. And I want to automate this process so if I could export all tileset (.tmx files) in one folder with just one click that would be super useful and would save me a lot of time.

It could be similar to Save All option just it would say Export All.

Could I do this maybe with custom command?

PS: I know that you are probably very busy and that you work on other features. Please let me know if there is any way of helping you. I would like to contribute to your project.

@bjorn
Copy link
Member

bjorn commented Mar 19, 2018

If it is I could it be implemented in such way that Tiled detects which files you have opened and just export them in the chosen format like JSON or CSV.

The issue title is a little confusing, but if you read the text of the first post you'll notice that this is not what @chasecromwell was asking for. It is about creating a file that mentions a bunch of tilesets, to ease adding all those tilesets to new maps. I wrote about the reservations I have about this approach above, which are still valid.

What has changed in the meantime though, is that any open external tileset is immediately usable on each open map, without needing to be explicitly added. Tiled automatically adds tilesets to the map as needed. Along with the planned support for projects (#1665), I expect this fully addresses the situation described by @chasecromwell.

It could be similar to Save All option just it would say Export All.

Could I do this maybe with custom command?

Regarding an actual "Export All" menu item, the problem with this is that it could only automatically export tilesets which have been exported before. For other tilesets it would need to prompt about the file name and format to export to. Also, for bulk exporting there exist command-line parameters so you can automate this process for maps and in the development snapshots also for tilesets (see #1872). Would this work for you as well?

PS: I know that you are probably very busy and that you work on other features. Please let me know if there is any way of helping you. I would like to contribute to your project.

There seems to be hardly a limit to things to work on, so indeed I am always busy and you're welcome to contribute! Even if it may not be to implement this feature in particular. :-)

@RokKos
Copy link

RokKos commented Mar 19, 2018

The issue title is a little confusing, but if you read the text of the first post you'll notice that this is not what @chasecromwell was asking for.

Yes, I read his description of the feature. But I wanted to suggest what would my solution be.

Also, for bulk exporting there exist command-line parameters so you can automate this process for maps and in the development snapshots also for tilesets (see #1872).

Yes this worked!!! 🎉 Thanks a lot you really made my day.
I found an example in this issue: #1117

I also made the simple batch script for Windows users (I am primarily Linux guy, but I develop a game on windows):

cd C:\path\to\folder
echo off

FORFILES /m "*tmx" /C "cmd /c tiled --export-map json @fname.tmx @fname.json"

BEFORE YOU RUN THIS SCRIPT SETUP ENVIRONMENT PATH FOR TILED

And I will also post bash scripts for macOS and Linux.

PS: I don't know yet how is on Linux and macOS but help for tiled command line is pretty basic. Is there maybe any quick to add the description for options as you did in the issue: #1117

@bjorn
Copy link
Member

bjorn commented Mar 20, 2018

Yes this worked!!! Thanks a lot you really made my day.

Awesome! :-)

PS: I don't know yet how is on Linux and macOS but help for tiled command line is pretty basic. Is there maybe any quick to add the description for options as you did in the issue: #1117

Of course more text could be added to the command line, but I think it may be better to add a page about using Tiled on the command-line to the documentation. Currently only the option to automate exporting is briefje mentioned on the page about Export Formats.

Once we have a page about using Tiled on the command-line (which could also finally cover other command-line tools like tmxrasterizer and terraingenerator), then for sure it would also be useful to document your batch / bash scripts!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants