• EditorBugs
  • Whitespace not removed for attachment sequence

Hi,
I'm trying to export an attachment (png) sequence using linked meshes. I'm trying to use the Binary export since that's what's recommended for PixiJS. The issue is that, even though I select "strip whitespace x" and "strip whitespace y" when exporting, the atlas images are not trimmed, they are also not in the shape of the mesh they're in but the shape of the original png.

These images are used for a glare animation, made in after effects and imported as linked meshes.
Here's a video preview:

I have tried messing with the pack settings, changing padding values, different packing options but still no luck.
I also tried just the texture packer option from Spine and that one gave me the results that I would expect the Binary export to give me as well.

These are the two exports compared side by side:

And these are my export settings:

Does anyone know how I could fix this?

I am using Spine 4.2.37

Related Discussions
...

It seems like the issue you're experiencing with whitespace not being removed during the export of your attachment sequence could be related to how Spine handles whitespace stripping for meshes. When using linked meshes, the whitespace stripping might not work as expected because the mesh vertices remain in the same positions, and only the texture changes. This behavior can result in the images not being trimmed to the shape of the mesh but rather retaining the original PNG shape.

To address this, ensure that your texture packer settings are correctly configured to strip whitespace. You might also want to try using the texture packer separately, as it seems to give you the expected results. Additionally, consider checking if your Spine and runtime versions are up to date, as there might be improvements or bug fixes in newer versions that could resolve this issue.

Here's the project file and all pngs if anyone wants to try to fix it on their computer 🙂

coin-problem.zip
1MB

When an image is used for a mesh, the pixels inside the mesh vertices cannot be whitespace stripped. For example:

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

It might seem that the bottom of this image could be stripped, since many rows of pixels are all whitespace from the left to right edges, but whitespace stripping cannot be done there. This is due to technical reasons regarding how textured meshes are rendered versus rending whitespace stripped texture regions. If you use region attachments, then the whitespace stripping can be done.

BTW, I noticed your animation has a number of deform keys. That may be OK, but in general it's better if you can do it with mesh weights. See here:
https://esotericsoftware.com/spine-keys#Deform-keys

Also, it can be difficult to match the movement of multiple meshes when keying their deform. Weights can make that easier, since the vertex movement is based on a bone moving and you can use Weld.