mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
Fixed parsing animations with no bone timelines.
This commit is contained in:
parent
b947ac02b6
commit
4ea3a8a632
@ -195,6 +195,7 @@ public class SkeletonJson {
|
|||||||
float duration = 0;
|
float duration = 0;
|
||||||
|
|
||||||
OrderedMap<String, ?> bonesMap = (OrderedMap)map.get("bones");
|
OrderedMap<String, ?> bonesMap = (OrderedMap)map.get("bones");
|
||||||
|
if (bonesMap != null) {
|
||||||
for (Entry<String, ?> entry : bonesMap.entries()) {
|
for (Entry<String, ?> entry : bonesMap.entries()) {
|
||||||
String boneName = entry.key;
|
String boneName = entry.key;
|
||||||
int boneIndex = skeletonData.findBoneIndex(boneName);
|
int boneIndex = skeletonData.findBoneIndex(boneName);
|
||||||
@ -233,8 +234,8 @@ public class SkeletonJson {
|
|||||||
for (OrderedMap valueMap : values) {
|
for (OrderedMap valueMap : values) {
|
||||||
float time = (Float)valueMap.get("time");
|
float time = (Float)valueMap.get("time");
|
||||||
Float x = (Float)valueMap.get("x"), y = (Float)valueMap.get("y");
|
Float x = (Float)valueMap.get("x"), y = (Float)valueMap.get("y");
|
||||||
timeline
|
timeline.setFrame(keyframeIndex, time, x == null ? 0 : (x * timelineScale), y == null ? 0
|
||||||
.setFrame(keyframeIndex, time, x == null ? 0 : (x * timelineScale), y == null ? 0 : (y * timelineScale));
|
: (y * timelineScale));
|
||||||
readCurve(timeline, keyframeIndex, valueMap);
|
readCurve(timeline, keyframeIndex, valueMap);
|
||||||
keyframeIndex++;
|
keyframeIndex++;
|
||||||
}
|
}
|
||||||
@ -245,6 +246,7 @@ public class SkeletonJson {
|
|||||||
throw new RuntimeException("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
throw new RuntimeException("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OrderedMap<String, ?> slotsMap = (OrderedMap)map.get("slots");
|
OrderedMap<String, ?> slotsMap = (OrderedMap)map.get("slots");
|
||||||
if (slotsMap != null) {
|
if (slotsMap != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user