Updating texture atlas

I’m using Texture Packer to generate texture atlases and their corresponding JSON definitions.

Today I had to update this texture atlas with new elements, so I replaced the texture, and then imported the JSON again. To my surprise, all the exported sprites had the wrong image now. I assume when they are exported they are linked to a numeric ID generated by the editor itself, not to their JSON “filename” value, which is the value that should stay constant between updates.

This is a big deal, because it means whenever I update my atlas I have to go through it again, export every single sprite and reassign it to every element in the scene. That’s really A LOT of work for a simple texture atlas update.

So, am I doing something wrong? Is there a way to keep atlases updated in a simple way, or should I expect to face this problem every time I need to make any update to an image that belongs to a texture atlas?

@vaios Something for you?

1 Like


Indeed the name of each frame in the TexturePacker json is not currently being considered as a unique ID. We could potentially have an option to search for a frame with the same name to replace when importing TexturePacker data, however this does not exist at the moment…

1 Like

Well, the way I see it, being able to update texture atlases without breaking the whole visual configuration is a very important feature.

Otherwise working with texture atlases creates a really time consuming workflow, since developing a game usually involves updating them several times.

Also generating all the sprites at once instead of going through them one by one would help a lot.

Updating texture atlases works in general as the order of frames is preserved, however in this case it appears that the ordering of frames in the exported json file is different… It would be interesting to see what happens if you export a TexturePacker json with say one more frame but the rest be the same and see if that breaks the import or not.

1 Like

I will check it out, I guess replacing any removed or renamed file with an empty image with the same name could do the trick, at least may be a better workaround than redoing everything.

Thanks for the hint.