Sprite sheet not exporting all frames on Packed mode [SOLVED - Caused by Custom Theme issue]

Hello.

Is there a reason why I export 43 frames and the sprite sheet has only 32 frames?
Is it ignoring duplicated frames?
I need all of them because BabylonJs doesn´t allow so much options at the time of setting up animations and I need each animation to be lineal.

You’ve selected the “Packed” option, which also forces the “Merge Duplicates” option, so frames that look identical are merged into a single frame in the sheet. If you export the JSON metadata, you’ll get separate frame data for those identical frames, but it’ll point to the same place in the sheet.

2 Likes

I think this window should automatically check (not only disable) Merge duplicates button for Packed option to avoid ambiguity.

1 Like

On the default theme, it does. Maybe this is a theme issue?

image

2 Likes

Aha! Theme icons creation misunderstanding problem.

Thanks for the screenshot.

So merge duplicated appears unchecked for “Packed mode” in my theme, but frames are actually being merged, and this option can’t be unchecked for “Packed mode”.

The problem is that I need the animation packed (textures width and height has a limit on mobile for perfonmance), and I need it doesn’t merge duplicated because Babylon JS has issues at the moment and the animations need to be lineal.

Why forcing merge duplicated on “Packed mode”? No sense in my opinion.
Some solution?

I’ll be using “By rows” mode and “Split tags”. For now that works.

Because without merging it’s not really packed, it’s just slightly compacted xP It’s very rare for a system to be able to parse a packed spritesheet without being able to deal with merged sprites.

You said Babylon JS requires animations to be “lineal”, but what does this mean? If it can deal with arbitrary positions and sizes like what you’d get in a packed spritesheet, then why would it care (or even bother checking) that some of those arbitrary positions are the same as others? The frames are still listed as separate frames in the JSON output, they just point to the same pixels in the spritesheet (possibly with different offsets), so the animation is still linear in that sense.

1 Like

Babylon JS can’t deal at the moment with arbitraty positions. It even doesn’t read properly JSONs, I have a thread open in the forum and waiting for a fix :-/ SpritePackedManager not working properly - Bugs - Babylon.js

Forcing merging frames is just not practical in some scenarios. Packed can mean packed or compact, it doesn’t matter so much, user should be able to choose how he want to pack frames in my opinion.

If it can’t deal with arbitrary positions, it probably won’t be able to deal with a packed sheet without merging either, since the sprites can end up in any order. You’re probably better off using one of the other options, perhaps with trimming enabled (if BabylonJS can handle that). It won’t be quite as tightly packed, but it should help avoid these bugs.