maxgribov/Spine

Fails to decode animation with curve

kvaDrug opened this issue · 5 comments

My animation is like:

"animations": {
"Rise right hand": {
	"bones": {
		"Arms Right": {
			"rotate": [
				{
					"curve": [ 0.144, 0, 0.645, -63.72 ]
				},
				....

When trying to load the skeleton, I'm getting this error:

typeMismatch(Swift.String, Swift.DecodingError.Context(codingPath: [Keys(stringValue: "rotate", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), Keys(stringValue: "curve", intValue: nil)], debugDescription: "Expected to decode String but found an array instead.", underlyingError: nil))

In AnimationModels.swift, at line 542.

Shortly, the problem, is that BoneKeyframeRotateModel expect animation to be like this (case at line 532):

"curve": 0.144,
"c2": 0,
"c3": 0.645,
"c4": -63.72

Or like this (line 543, AnimationModels.swift):

"curve": "bezier"

But the actual timing is encoded like an array:

"curve": [ 0.144, 0, 0.645, -63.72 ]

Why is it different? May be because Spine editor version was updated. I use 4.0.45.
If you ask, I can rise a PR to fix this issue.

I got the same problem.. unfortunately it seems like this was abandoned

I got the same problem.. unfortunately it seems like this was abandoned

Sure. Spine is a paid software and shouldn't rely on open-source enthusiasts. They should create their own framework or support this one. Need to contact the team.

fixed in v3 branch. Not yet merged in master, still WIP some other features

@maxgribov, wow! How are you?

I am fine. Found time to update Spine lib. )