fix some error in modify anim

This commit is contained in:
zimzaza4
2024-09-28 15:40:39 +08:00
parent 45c9de0337
commit 8e40bc4246

View File

@@ -59,6 +59,9 @@ public class Animation {
if (animation.has("loop")) {
if (animation.get("loop").getAsJsonPrimitive().isString()) {
if (animation.get("loop").getAsString().equals("hold_on_last_frame")) {
if (!animation.has("bones")) {
continue;
}
for (Map.Entry<String, JsonElement> bone : animation.get("bones").getAsJsonObject().entrySet()) {
for (Map.Entry<String, JsonElement> anim : bone.getValue().getAsJsonObject().entrySet()) {
@@ -67,6 +70,7 @@ public class Animation {
if (!anim.getValue().isJsonObject()) {
continue;
}
try {
for (Map.Entry<String, JsonElement> timeline : anim.getValue().getAsJsonObject().entrySet()) {
float time = Float.parseFloat(timeline.getKey());
if (time > max) {
@@ -76,6 +80,7 @@ public class Animation {
}
}
}
} catch (Throwable t) {}
if (end != null && end.get("lerp_mode").getAsString().equals("catmullrom")) {
end.addProperty("lerp_mode", "linear");
}