bernie-g/geckolib

Animations not being parsed correctly

Scouter456 opened this issue · 2 comments

Also experiencing this with nested usages of math.lerp

Geckolib.CompoundException: Unable to parse animation: create_glyph2
	-> Failed to parse expression 'math.lerp(math.lerp(0, 12, query.anim_time*0.75), math.lerp(12, 6, query.anim_time*0.75), query.anim_time*0.75)'
		-> Unable to parse compiled symbols from expression: [Left[math.lerp], Left[00]]
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.math.MathParser.parseSymbols(MathParser.java:377)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.math.MathParser.compileSymbols(MathParser.java:325)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.math.MathParser.compileExpression(MathParser.java:225)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.math.MathParser.compileMolang(MathParser.java:217)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.math.MathParser.parseJson(MathParser.java:179)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.json.typeadapter.BakedAnimationsAdapter.buildKeyframeStack(BakedAnimationsAdapter.java:164)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.json.typeadapter.BakedAnimationsAdapter.bakeBoneAnimations(BakedAnimationsAdapter.java:74)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.json.typeadapter.BakedAnimationsAdapter.bakeAnimation(BakedAnimationsAdapter.java:58)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.json.typeadapter.BakedAnimationsAdapter.deserialize(BakedAnimationsAdapter.java:38)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.json.typeadapter.BakedAnimationsAdapter.deserialize(BakedAnimationsAdapter.java:30)
	at MC-BOOTSTRAP/com.google.gson@2.10.1/com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76)
	at MC-BOOTSTRAP/com.google.gson@2.10.1/com.google.gson.Gson.fromJson(Gson.java:1227)
	at MC-BOOTSTRAP/com.google.gson@2.10.1/com.google.gson.Gson.fromJson(Gson.java:1329)
	at MC-BOOTSTRAP/com.google.gson@2.10.1/com.google.gson.Gson.fromJson(Gson.java:1271)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.loading.FileLoader.loadAnimationsFile(FileLoader.java:36)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.cache.GeckoLibCache.lambda$loadAnimations$1(GeckoLibCache.java:76)
	at TRANSFORMER/geckolib@4.5.6/software.bernie.geckolib.cache.GeckoLibCache.lambda$loadResources$5(GeckoLibCache.java:113)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

https://github.com/baileyholl/Ars-Nouveau/blob/1.21.x/src/main/resources/assets/ars_nouveau/animations/scribes_table_animations.json

Replacing the lerp calls inside the lerp with constants compiles fine. Seems to be anything that involves a function inside a function.

Excellent error finding, thanks