Immersive Aircraft [Fabric/Forge]

Immersive Aircraft [Fabric/Forge]

18M Downloads

[REQUEST FOR ADDON CREATION] Allow the blockbench model renderer to read molang math. functions

Closed this issue ยท 2 comments

commented

I am currently creating an addon for your mod with the goal to add some more fantasy aircrafts for my own personal use.

Because of the nature of the models I created, I need to use molang's math functions such as math.sin() math.min() math.max()
but saddly the parser that the mod uses to parse the mathematical strings from the animation frames cannot read these functions.
BUT! It can read functions as sin() cos() min() max(), so my workaround is simply removing all math.'s from my animation frames before saving the model

taking a look at your source code I saw a line that replaces all variable. with variable_ from the animation frames, I imagined that you could do the same to auto remove all math.'s as well

there are some functions such as math.mod() and math.clamp() that don't seem to work even when removing math. so I assume its not available in your parser

Its a small thing but it is helpful to allow more complex animations on the aircrafts models!

(sorry for any grammar issues, english is my second language)

commented

I can do that, but we are stacking hacks here. IA does not use MoLang at all; I picked Mathparser for the sake of "it just works". I wrongfully reused the animation field in blockbench just for simplicity. Instead of gradually reimplementing MoLang features, maybe it's better to find a proper (bundled) library all together? (I would really want to avoid depending on e.g. GeckoLib).
So tldr I think it's better to use the Mathparser syntax, even if it's not "blockbench-like". Mod, for example, is the # operator, and clamp is a nested min(max()).

commented

ohh i see thank you then :)