• Editor
  • Please explain scale keyframe values

  • Editado
Related Discussions
...

I'm trying to understand the values I see in Spine JSON for scale keyframes. According to the docs:

scale keyframe attributes:

  • x: The bone's X scale relative to the setup pose. Assume 1 if omitted.
  • y: The bone's X scale relative to the setup pose. Assume 1 if omitted.

I can't figure out what "relative" means, though. For example, if I start out with zero for scale x and y in the set up pose, and want set the scale keyframe data to go from scale (0, 0) to scale (1, 1), I don't get what I expect at all! When I load this data into the Spine editor, I get the object starting at scale (-1, -1) and ending at scale (0,0).

Here's another unintuitive example:
Start with a bone at scale (0.9, 3). Let's say you want that bone to be at scale (1, 1) at the end of the animation. What value would you use as the last scale keyframe? . . . Somehow, it's (1.1, -1).

What is the formula?

Hmm sounds like something is broken. Do you have a project you can share at contact@esotericsoftware.com with your findings, then we can look into it.

Thanks - I was just about to follow up that I got a formula that works.

Given a bone scale of ( BX, BY ) and a keyframe scale of ( KX, KY )
the values in JSON for that keyframe will be ( 1 + KX - BX, 1 + KY - BY )

p.s. I didn't notice it until just now, but in the docs, both x and y refer to "The bone's X scale..."

7 días más tarde

EDIT


(moving this to the above thread)

Nate, I know you guys are neck-deep in the new release, but with the new code, bones that have zero for scale in their set-up pose no longer work at all.

For example:
Go into the Editor, new project, in Setup mode and set a 0, 0 scale on "root".
Go into Animation mode and keyframe scale at frame zero.
Now try to set a keyframe to scale 1, 1 at frame 20.
Drag the time around. The scale boxes are blank, and it doesn't have the expected result at any time.

8 días más tarde

We've been discussing this internally on what to do with bones that have 0 scale in Setup mode. It doesn't make much sense to have a bone with a scale of 0 in Setup mode, better to use a very low scale like 0.01 and hide the slot, then when you need to show it you can just scale it up and show the slot.

There were some bugs with scale, but this was fixed recently.