heygleeson / godot-ldtk-importer

LDTK Importer for Godot 4
MIT License
156 stars 15 forks source link

Custom TileSet Data Layer is not created #37

Open aniezurawski opened 2 months ago

aniezurawski commented 2 months ago

Unfortunately I cannot reproduce this issue in form of some minimal example project (works as expected) but it does not work in my bigger project. It stopped working after I upgraded from 1.2 to 2.0.1.

Is it known bug? Any known workarounds? I don't see anything helpful in verbose output.

image image

aniezurawski commented 2 months ago

I did some additional tests. It works when there is only a single tilesheet in my tileset_8px.res file and I delete it completely from filesystem and reimport again (simply reimporting after deleting all but one sheet does not solve it).

~Attaching an example project. Custom data is not imprted when there are two sheets in tileset. test.zip~

EDIT: Turned out it's not good example because there was an issue with one tile source.

aniezurawski commented 2 months ago

Ok, I figured it out.

If there are multiple LDTK TileSets (TileSetSource/tilesheet) in a single Godot TileSet then method add_tileset_custom_data is called for every single one of them in a loop and so clear_custom_data is called everytime. So effectively Custom Data works only for the very last TileSetSource.