Closed kvaDrug closed 4 years ago
Designer in our team uses Spine 3.8.72. The "time" parameter sometimes is missing in animations there, for example:
"bones": { "Body": { "rotate": [ { "angle": -178.61 }, { "time": 0.5, "angle": 176.27 }, { "time": 1.1667, "angle": -174.45 }, { "time": 1.5, "angle": -178.61 } ] } }
Here you can see that the first "angle" items goes without "time". If you try to create a Skeleton from this json, it will fail.
In this pull requests I fix all the animations assuming that missing "time" simply means "time": 0. This is achieved by replacing
"time"
"time": 0
container.decode(TimeInterval.self, forKey: .time)
with
decodeIfPresent(TimeInterval.self, forKey: .time) ?? 0
Bonus: .gitignore file to remove .DS_Store etc. from commits.
Already fixed in v2.0
Designer in our team uses Spine 3.8.72. The "time" parameter sometimes is missing in animations there, for example:
Here you can see that the first "angle" items goes without "time". If you try to create a Skeleton from this json, it will fail.
In this pull requests I fix all the animations assuming that missing
"time"
simply means"time": 0
. This is achieved by replacingwith
Bonus: .gitignore file to remove .DS_Store etc. from commits.