EsotericSoftware / spine-editor

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

When the Mix of a transform constraint is set to -100, the transform will be offset when adding the key of the constrained bone. #809

Closed misaki-eymard closed 1 week ago

misaki-eymard commented 3 weeks ago

Description: When the Mix of a transform constraint is set to -100, the transform will be offset when adding the key of the constrained bone. For example, if the Mix of the Translate is set to -100, move the target bone, and then add a key for the translate of the constrained bone, the position of the constrained bone will be offset. This occurs in the default state where Local and Relative are not enabled. Also, this problem only occurs when the Mix is -100, not at -120, -50, or 100.

Expected behavior: When you add the transform key of a bone that is constrained by a transform constraint, the transform is keyed as it appears in the viewport.

Steps to reproduce:

  1. Create a new Spine project using Spine 4.2.32.
  2. Create two new bones, select one of them to create a transform constraint, and select the other as the target bone.
  3. Set the Mix of all properties of the transform constraint to -100.
  4. Switch to the animate mode and create an animation of the target bone's rotation and translation.
  5. In the middle of the animation, the constrained bone rotation and translation keys are recorded. You can see that the constrained bone rotation and translation are offset at the moment the keys are recorded.

The version of Spine in which this problem was found: Spine 4.2.32

This problem was reported in the following thread on the forum: https://esotericsoftware.com/forum/d/26416-%E5%8F%98%E6%8D%A2%E7%BA%A6%E6%9D%9F%E7%9A%84bug

NathanSweet commented 1 week ago

When a key is set, it is set using the unconstrained property value, except when a bone is controlled 100% by a constraint. This allows keying a constrained bone to "bake" the effect of the constraint. We should add this to the user guide, if not already there (or to the "missing from user guide" issue).

For the purposes of setting keys, we consider -100 transform constraint mix to be 100% controlled. When the key is set to the constrained value, it causes a jump because the constraint is now moving the bone from a different position. This is probably not useful.

In 4.2.34 we no longer consider -100 transform constraint mix to be 100% controlled for setting keys. We still do for other purposes, for example bone tools cannot move a bone controlled by a transform constraint with mix 100 or -100.