• Bugs
  • Scaling bone messes up animation order

Related Discussions
...

Hi

I am using spine with libgdx. And having a weird issue.
Basically as it is mentioned here: http://esotericsoftware.com/spine-loading-skeleton-data

There are 2 ways to scale animation, for our purposes it makes sense to use the second method which is finding root bone on skeleton data and scaling it. Weird thing is, when this is done, the order of animation messes up, as in things happen out of order. If I scale SkeletonJson instead, everything is fine. (But that will mess up positioning so can't use that).

I am linking a sample project to show the issue in action.
http://kiki-fish.com/uploads/scale_issue.zip

It has the spine project, libgdx project, (and spine runtimes in same folder for thing to work out of the box). This also contains JAR to visualize the problem (on the top the crack animation is as it should be, and on the bottom it's wrong, and all difference is in the method it is being scaled)

We spent like 2 days on this, and most probably doing something wrong.. but deadlines are coming, and any help is much appreciated!

Best.

Just tested same thing IN the editor, and it seems this is not runtime related, because if I scale root bone in the editor it has same effect. That is weird. So it has to do with the way animation is rigged. But I have no idea what's wrong. Should I still put it in tracker?


It's like as if "constraint scale" is not being affected by the root bone scale.


UPD: Also, when we try to change constraint scale now manually in the editor (the new version) it just freezes. (when the root bone is scaled. It is reproducable every time)


UPD2: So I did some digging, and made a video to show exactly what's going on, as you can see animation works just fine, but when root bone is scaled, it somehow makes all bones clamp up in single spots, reason being, scale of each bone is affected in such a way, that it's 0. When I click on a bone that is affected, it shows as 0 scale for X, and you can see that at some point it swaps to become "1" without me typing it, I just clicked. And then it goes back to 0 if clicked again. Due to this problem you can see how animation looks all wrong. because most of it is scaled into single 0 scale points. And all I did was to scale root bone to 0.3

Here is the video:

I looked at the project. Neat use of paths!

I don't see any freezing. Can you please provide steps to reproduce that?

You are using Length for the spacing mode on your paths. This uses the scaled bone length as the space between bones, which is fine so far. When you adjust length spacing in setup mode or key spacing, the amount you specify is added to each bone length, but that amount is not scaled and this is your problem. You probably want to use Percent, which should be acceptable since your bones appear to be all the same length.

Should the spacing amount be scaled? Since the bone scaled bone length is used, I think it makes sense. Since this changes the path constraint behavior, we shouldn't make the change in 3.5 but it can be in 3.6. You can port it to 3.5 yourself if you like:
Scale path spacing.@8e0972d

Thanks for getting back Nate! really appreciate it.

I'll try to see if changing to Percent will fix it, and get back to you!

As for the freezing, here is how to reproduce.
Open the project, and in setup mode select root bone and change it's scale to 0.3, 0.3, then click on "setup" to enter the animation mode. select a path constraint (seems does not matter which one) then change the scale value on it. click somewhere on empty canvas, things get frozen and not responsive anymore.

As to why we did use length instead of percent (according to our animator), when you select percent, the "scroll" bar near it, is kind of "shaky and jumps in a weird way" so that it's not very convenient to use.


UPD: using percents did help! And also pulling the changes from 3.5 can be good idea for our other old animations. So we'll check that as well. Huge thanks!

I don't see that the percent slider is shaky or jumps. Can you explain more, or screen capture? For the number of bones you have, you'll probably be changing percent spacing from 0 to 7%, so there aren't a lot of pixels to drag the slider. You can make the tree view wider to increase accuracy, or type in numbers. We've increased the decimal places to 2 for percent mode which should help a little. We also plan to support up/down arrows and mouse scrolling for the sliders which may help to make small changes.

Thanks for the repro steps! The hang seemed to be caused by enter 0 into scale in certain situations. Fixed in the next 3.5 version.