TexturePacker support for Godot 3

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AndreasLoew

Hi,

my name is Andreas Löw, I develop TexturePacker - a sprite sheet packer and optimization tool.
Recently I get more and more requests for support for Godot engine… I am new to Godot engine and currently trying to find a starting point. Or a complete solution if somebody is able to deliver it ;-)

How I’d image the things should work (from a users view)

  1. Somebody packs the sprite sheet in TexturePacker, presses publish
  2. User switches to Godot, sprite sheets and sprites are reloaded and refreshed, animations play,…

I’d really like to avoid that users have to perform manual steps to get the updated sprites.

I would also like to support as many features from TexturePacker as possible.

1. Using irregular sprite sheets with trimmed sprites (transparency removed to save space)
seems to be possible by creating .tres files of type “AtlasTexture” with region and margin. Initially creating the .tres files works but the preview images don’t update. The other problem is to know the ids.

2. Rotated sprites (optional, but would improve packing)
there seems no way to tell Godot that a region is rotated

3. Pivot points (optional)
there seems to be no way to transport the pivot point from the AtlasTexture to the sprite…

4. Polygon mesh sprites + polygon packing
TexturePacker can create sprite meshes instead of rectangular sprites. This creates less overdraw and improves the performance of games. It also allows very tight packing of the sprites. I’ve seen in a tweet that Godot is going to get mesh support. Is there already some way to set meshes? Especially for sprites and sprite animations?

Is creating the .tres files an option at all? Or do I have to follow another path?

I’d really be happy if somebody could lend me a hand on this. I’m also able to pay some amount of money for somebody delivering a solution.

Best
Andreas

Hi Andreas,

I have used texture packer before. Top notch tool! Plz post this on some of the other sites as well (e.g. Godot reddit, etc.) for more exposure. I would love to see TP have Godot 3 option. =)

2D||!2D | 2018-03-01 12:55

Ok… Reddit - Dive into anything

AndreasLoew | 2018-03-01 14:11

:bust_in_silhouette: Reply From: Lisandro Lorea

Since most functionally you need is already covered or being worked on by the engine devs I think you could just create an editor plugin to create the tres files and setup the sprite pivot. You can use json hash or array as intermediate format.
Once mesh sprites land on stable you can add support for that.
The only missing thing would be rotated sprites but I don’t think it’s worth creating a module just for that.

Creating editor plugins: Making Plugins — Godot Engine (3.0) documentation in English

If you want to hire someone, the devs usually hang out in #godotengine-devel on Freenode. They’ll be able to recommend someone. Kiwi IRC

Thanks. I’ve meanwhile managed to create the plugin. Works except for some smaller bugs in Godot’s UI which don’t update the sheets immediately.

I am currently polishing the importer to submit it to the asset library.

I’ve created an extended intermediate format that also supports multipack with 2 exporters: 1 for TileSets and one for sprite sheets (AtlasTexture).

AndreasLoew | 2018-03-07 07:26