EsotericSoftware / spine-editor

Issue tracking for the Spine editor.
http://esotericsoftware.com/
29 stars 2 forks source link

Image export does not correctly detect maximum bounds when no animation is selected #787

Closed misaki-eymard closed 5 months ago

misaki-eymard commented 6 months ago

Description: Depending on whether animation is selected or not, the maximum bounds for exporting in image formats such as GIF and PNG will vary. The animation selected does not have to match the animation to be exported; as long as an animation is selected, the image can be exported without being cropped.

This behavior can cause undesirable cropping, especially when performing exports via the CLI.

Expected behavior: Whether or not an animation is selected, the maximum boundary of the animation is correctly recognized.

Steps to reproduce:

  1. Download the attached .zip file: incorrect-bounds.zip
  2. Open the Spine project contained in the .zip with Spine 4.2.64-beta.
  3. Switch to the animate mode.
  4. Do the GIF export with the default settings.
  5. You should see the following results for the exported image: exported-GIF
  6. Then, after select the animation on the Tree view, do the GIF export with the default settings again.
  7. You should see the following results for the exported image: exported-GIF

The version of Spine in which this issue was found: Spine 4.2.64-beta

This issue was reported on the following thread: https://esotericsoftware.com/forum/d/25962-%E5%85%B3%E4%BA%8Egif%E5%9B%BE%E7%89%87%E5%AF%BC%E5%87%BA%E7%9A%84%E9%97%AE%E9%A2%98

NathanSweet commented 5 months ago

4.2.66-beta

NathanSweet commented 5 months ago

There was a misunderstanding as to how this should work. Region sequences always use the size of the setup sequence frame. If some images in the sequence are a different size, they are scaled to the size of the setup sequence frame. This is similar to how it works for meshes.

Requiring the same size (or scaling) is what most users will do anyway. Any extra whitespace can be stripped by texture packing.

It works this way for simplicity and technical reasons. There is less work to do at runtime to change the region. Also, for exports, we would need to load ALL sequence images to determine their size before we could start an export, and then load them all again to perform the export.