EsotericSoftware / spine-editor

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

Draw order animation may get incorrect when moving slots to an existing folder. #793

Closed misaki-eymard closed 4 months ago

misaki-eymard commented 4 months ago

Description: If slots whose draw order changes during animation are moved to an existing folder, the animation of the draw order change may be incorrect.

Expected behavior: The animation of changing the drawing order remains in its original state even if the slots are moved to an existing folder.

Steps to reproduce:

  1. Download the attached .zip file: draw-order-issue.zip
  2. Confirm the skeleton's slots are arranged in the following order in the setup pose: Screenshot 2024-05-13 at 15 46 09
  3. Switch to the animate mode and confirm the order of slot 04_plant-green is changed to the second from the top during the animation: Screenshot 2024-05-13 at 15 46 21
  4. Go back to the setup mode and move all slots under the Folder folder: Screenshot 2024-05-13 at 15 51 35
  5. Then switch to animate mode and you will see that the 04_plant-green slot, which should be the second from the top, is now topmost: Screenshot 2024-05-13 at 15 46 43

Workaround: This bug only occurs if the folder is created before the slots are moved, so it does not occur if a folder is created with the slots selected and the selected slots are moved to the new folder.

The version of Spine in which this bug was found: Spine 4.2.20

This issue was reported on the following thread: https://esotericsoftware.com/forum/d/26156-%E8%A1%A8%E7%A4%BA%E9%A0%86%E3%81%A8%E3%82%B3%E3%83%B3%E3%82%B9%E3%83%88%E3%83%AC%E3%82%A4%E3%83%B3%E3%83%88%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6--problems-with-drawing-order-and-constrained-folders/4

NathanSweet commented 4 months ago

The problem occurs even without the folder, when the slots are all dropped above the top slot.

The problem appears to occur only when all the slots are moved, which wasn't possible before adding folders. Our algorithm for smartly adjusting the draw order stored in animations fails in that case.

Fixed in 4.2.21.