A simple Python script to convert GeckoLib animations exported from Blockbench as Bedrock .animation.json files into Java Edition compatible files.
🐛 Report Bug
·
✨ Request Feature
Table of Contents
Blockbench's Bedrock animation export writes some keyframes as objects with pre and post
values (for smooth interpolation, or a jump at a keyframe). The Java Edition version of GeckoLib
expects a plain value at each keyframe, so it can't read them. This script replaces every such
keyframe with its post value and leaves everything else as it was.
Before:
"rotation": {
"0.0": [0, 0, 0],
"0.5": { "post": [0, 45, 0], "lerp_mode": "catmullrom" },
"1.0": { "pre": [0, 90, 0], "post": [0, 0, 0] }
}After:
"rotation": {
"0.0": [0, 0, 0],
"0.5": [0, 45, 0],
"1.0": [0, 0, 0]
}You need Python 3. There's nothing to install.
python main.py ./model.animation.json ./output.animation.jsonOn Windows, use py instead of python. The first argument is the exported animation, the
second is where to write the converted one. Give it a new file each time: the script appends
to the output file, so writing over an existing one leaves invalid JSON.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Rhys Bishop - https://sy.hr/ - mail@rhysbi.shop
Project Link: https://github.com/ssyyhhrr/geckolib-animation-converter