mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-19 23:19:20 +00:00
fix some error in modify anim
This commit is contained in:
@@ -59,6 +59,9 @@ public class Animation {
|
|||||||
if (animation.has("loop")) {
|
if (animation.has("loop")) {
|
||||||
if (animation.get("loop").getAsJsonPrimitive().isString()) {
|
if (animation.get("loop").getAsJsonPrimitive().isString()) {
|
||||||
if (animation.get("loop").getAsString().equals("hold_on_last_frame")) {
|
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> bone : animation.get("bones").getAsJsonObject().entrySet()) {
|
||||||
|
|
||||||
for (Map.Entry<String, JsonElement> anim : bone.getValue().getAsJsonObject().entrySet()) {
|
for (Map.Entry<String, JsonElement> anim : bone.getValue().getAsJsonObject().entrySet()) {
|
||||||
@@ -67,15 +70,17 @@ public class Animation {
|
|||||||
if (!anim.getValue().isJsonObject()) {
|
if (!anim.getValue().isJsonObject()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (Map.Entry<String, JsonElement> timeline : anim.getValue().getAsJsonObject().entrySet()) {
|
try {
|
||||||
float time = Float.parseFloat(timeline.getKey());
|
for (Map.Entry<String, JsonElement> timeline : anim.getValue().getAsJsonObject().entrySet()) {
|
||||||
if (time > max) {
|
float time = Float.parseFloat(timeline.getKey());
|
||||||
max = time;
|
if (time > max) {
|
||||||
if (timeline.getValue().isJsonObject()) {
|
max = time;
|
||||||
end = timeline.getValue().getAsJsonObject();
|
if (timeline.getValue().isJsonObject()) {
|
||||||
|
end = timeline.getValue().getAsJsonObject();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (Throwable t) {}
|
||||||
if (end != null && end.get("lerp_mode").getAsString().equals("catmullrom")) {
|
if (end != null && end.get("lerp_mode").getAsString().equals("catmullrom")) {
|
||||||
end.addProperty("lerp_mode", "linear");
|
end.addProperty("lerp_mode", "linear");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user