EsotericSoftware / spine-editor

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

Add a setting to adjust the number of curve segment divisions for very large skeletons. #846

Open misaki-eymard opened 1 week ago

misaki-eymard commented 1 week ago

If a curve is sharply curved or very large, it may be possible to see the line segments that make up the curve. In general, even if a curve is not smooth enough, this can be easily solved by adding more keys. However, if you are animating a very large skeleton using very high resolution images, it is often the case that the curves will not be smooth. For example, in the following example, the length of the red bone is set to about 1000 and the length of the blue bone is set to about 1400, but if you create a subtle offset with a very long bone like this, you can easily see that there is a jerk when slowing down (look at the tip of the blue image.): exported-gif

If you add a few more keys and smooth them out, it will look like this: exported-gif-smooth

The Spine project for this example is here: Add an option to adjust the number of curve segment divisions for very large skeletons.zip

As you can see, it is possible to make movements smoother by adding keys, but this will result in a very large number of curves that need to be keyed, and the animation will become complicated with too many keys. It would be useful if there was a setting that allowed you to change the default number of segments for curved segments for very large skeletons.

Related forum thread: https://esotericsoftware.com/forum/d/27093-%E5%85%B3%E4%BA%8Espine%E6%9B%B2%E7%BA%BF%E9%87%87%E6%A0%B7%E7%9A%84%E9%97%AE%E9%A2%98

NathanSweet commented 1 week ago

Spine uses 10 Bezier segments, regardless of the duration between keys or steepness of the curves. It is visible in the dopesheet:

In the provided project the jerkiness from the 10 segments is magnified by the use of 3 bones in a chain.

The provided smooth animation uses many new keys, but it can be fixed by adding a single key in the middle of the curve (for each of the 3 bones, eg ctrl+shift+L to key visible):

Doing that does not seem onerous and is not often needed. It works because there are now 20 segments between the 2 original keys.

The 10 segment limit is currently hardcoded in all runtimes for performance. Making the segments customizable would add some processing overhead to all animation timelines (even those using the default of 10) and would increase memory when increased beyond 10. Such a setting is possible, but would likely be per animation so that all keys have the same number of segments, which is needed for performance.