spine-editor icon indicating copy to clipboard operation
spine-editor copied to clipboard

Snap to whole or half numbers

Open erikari opened this issue 5 years ago • 6 comments

Suggestion: Add a setting that allows to snap translation in the viewport to the selected axes. This could be set in the settings dialog and on all the time, unless shift is held, like other snapping (e.g. in the dopesheet)

The main use case is to have more precision for pixel art animators.

Related forum thread: http://esotericsoftware.com/forum/Can-we-snap-to-whole-or-half-numbers-in-Translate-tool-13922

erikari avatar May 07 '20 16:05 erikari

+1 here: http://esotericsoftware.com/forum/Precision-Path-and-Clipping-creation-17355

misaki-eymard avatar Apr 07 '22 07:04 misaki-eymard

+1 here: http://esotericsoftware.com/forum/Pixel-Art-17821

misaki-eymard avatar Aug 02 '22 23:08 misaki-eymard

We have this in 4.2: the Pixels button on the main toolbar, under the bones and images compensation buttons.

NathanSweet avatar Mar 14 '24 00:03 NathanSweet

The Pixels compensation is for keeping regions on whole pixels in setup mode when bones are moved. We can reopen this for keeping bone translation on whole or half pixels.

NathanSweet avatar Mar 14 '24 00:03 NathanSweet

For pixel art, this setup can be used:

  1. Enable nearest neighbor filtering.
  2. Place regions correctly on even or odd positions (toggling Pixels in 4.2+ is easiest).
  3. Now when you translate bones to fractional positions, your regions will always match screen pixels. You'll never lose a row/column from translation. Rotation, scale, or shear will still of course have filtering.

When doing this there's no need to place bones on whole number world coordinates. At runtime the app should also use nearest filtering to get the same effect.

Given that, I'm not sure there's still a need for snapping. I'll leave this open for now. If anyone has a use case for snapping, please comment.

NathanSweet avatar Apr 02 '24 01:04 NathanSweet

At runtime you may want linear or bicubic filtering so things in motion are smooth, but you want things at rest to match screen pixels. In this case it is necessary for bones to move in whole number increments compared to the setup pose.

NathanSweet avatar Apr 14 '24 17:04 NathanSweet