Provide a set of Java libraries that can
Parse existing Lottie animations to Java objects.
Generate Lottie files from Java objects.
Play Lottie animations in JavaFX.
And achieve this by using a recent Java version with the use of Records to minimize the code and make the project easy to maintain, test, and extend.
Hmm, the Lottie data format is harder to understand than I hoped… I already knew it’s not a logical nested structure, but actually there is a lot of references to data in other structures inside the JSON.
So, to be honest, I’m in the typical worst point that every project faces…
(Graph from bettersheepdog.blogspot.com)
But on the bright side, we have our first correct color and stroke width output! The right pink border is the same as on the left, so I know where to find some info to be used in the drawing…
Based on a LottieFile with an animation, created with Flow, the Bezier object needed to be extended in two different objects: FixedBezier and AnimatedBezier.
Added FixedBezier and AnimatedBezier with BezierDeserializer
Extended unit tests
FXPlayer and FXDemo
Loading of initial test file
Position, colors, strokes… still to be done
Core: can already load many different JSON files
But not all yet…
To be added to the unit tests and the model needs to be further extended
FXPlayer: very basic visualizer
Can read a basic Lottie JSON file and draw the paths
See below with DemoApplication.java showing the original Lottie on the left, and the very first JavaFX generated image on the right.