Updating sprites from (Texture Packer ) texture atlases

Hi there, I’m new to this forum and fairly new to Playcanvas, so apologies if this is a bit of a newbie question, I hope this hasn’t been posted already (I have had a read through but not found any posts).

I have a project where I built all of the screens and UI using sprites generated from a series of texture atlases, made from texture packer. Now the artists have supplied me with some updated graphics (some of which are different sizes etc) and I have rebuilt the series of texture atlases in TP and obviously everything on the atlases has shuffled around a bit, but they all have the exact same names as before.
But now I can’t figure out a way to replace the sprites used in the play canvas project.
Is there a way of doing this, and if not, how do you guys deal with updates to UI - should I not have used TP texture atlases?
Many thanks

Unfortunately the Sprite Editor doesn't support replacing frames by name yet :( so it's a slog to update all the references.

Using TP is the ‘best’ route and we will look at adding this feature.

Some developers create new sprite assets in a new folder and one by one, right click on the old sprite asset, replace with and select the new asset. This is not ideal.

Edit: Yes it does, I’m an idiot!

Thanks for your swift reply, Just looked at the right click to replace method you mentioned, but the “replace” option doesn’t appear in the contextual menu on sprites that are used in the project.

I guess I’m going to have to go through each of the screens and replace each sprite.
And make sure there aren’t any further amends :pleading_face:

This would be an essential feature for me to have on future projects, as the workflow really suffers.
Many Thanks

@milnerdiscrete I’ve just tried this myself and don’t seem to hit the same issue you do when the texture atlas is updated. I’ve attached a video to see if there are any steps I may have missed

Thanks for the vid. yep, it works with a single sheet, however, if Texture packer moves a sprite from one sheet to another when it repackages. You run into problems
Many Thanks

Oh, you have multiple atlases (as I see now in the title, sorry!). Ideally (and we should perhaps add this to the documentation), related sprites should be on the same texture atlas so moving sprites from one atlas to another should be deliberate action and not done by the tool.

If it’s only a few sprites and as long as you know which sprites they are, on the sprite asset you might be able to get away with changing the texture atlas reference:

Side note: You can group select multiple assets (hold Cmd/Ctrl) and change the atlas on all of them at once

1 Like

Thanks, I’m going to repackage them now to specific atlases rather than use multipack. But a replace by name functionality would be awesome.

I think it would be tough to do due to the relationship between the sprite atlas and the sprite asset. The sprite asset references the atlas and there is no knowledge of the sprite assets at the texture atlas level :thinking:

We could potentially have update sprite asset from frame in the sprite editor :thinking:

If you could add a feature request for this in the repo, that would be great and we be able to see how requested this feature is :slight_smile: