Animated-texture generator for Minecraft
Anitexgen is a generator for ".mcmeta" files that Minecraft uses to animate textures.
It allows you to write texture animations in Python instead of json. Using a proper programming language enables you to create much more complex animations, like this model that uses 3 animated textures to create a moving dog.
Installation
pip install mcanitexgen
Usage
Generate .mcmeta files for all animations in an animation file
$ mcanitexgen generate <animation_file>
-o, --out The output directory of the generated files
-m, --minify Minify generated files
-i, --indent Indentation used when generating files
--dry Dry run. Don't generate any files
Create gifs for all animations in an animation file
$ mcanitexgen gif <animation_file>
-o, --out The output directory of the generated files
Getting started
Create a simple animation
We are going to create this blinking Steve:
First we have to create the different states of the animation.
I created a simple steve.png file:
Top to Bottom: Looking normal, blinking, wink with right eye, wink with left eye.
Now we can create the animation file steve.animation .py that uses these states to create an animation:
from mcanitexgen.animation import animation, TextureAnimation, State, Sequence
@animation("steve.png")
class Steve(TextureAnimation):
NORMAL = State(0) # Look normal
BLINK = State(1)
WINK_RIGHT = State(2) # Wink with right eye
WINK_LEFT = State(3) # Wink with left eye
# Look normal and blink shortly
look_and_blink = Sequence(NORMAL(duration=60), BLINK(duration=2))
# The main Sequence used to create the animation
main = Sequence(
3 * look_and_blink, # Play "look_and_blink" Sequence 3 times
NORMAL(duration=60),
WINK_LEFT(duration=30),
look_and_blink,
NORMAL(duration=60),
WINK_RIGHT(duration=30),
)
Files overview:
resourcepack
⠇
textures
└╴ item
├╴steve.png
└╴steve.animation.py
Passing the animation file to Anitexgen will create a steve.png.mcmeta file:
$ mcanitexgen generate steve.animation.py
steve.png.mcmeta
{
"animation": {
"interpolate": false,
"frametime": 1,
"frames": [
{"index": 0, "time": 60},
{"index": 1, "time": 2},
{"index": 0, "time": 60},
{"index": 1, "time": 2},
{"index": 0, "time": 60},
{"index": 1, "time": 2},
{"index": 0, "time": 60},
{"index": 3, "time": 30},
{"index": 0, "time": 60},
{"index": 1, "time": 2},
{"index": 0, "time": 60},
{"index": 2, "time": 30}
]
}
}
resourcepack
⠇
textures
└╴ item
├╴ steve.png
├╴ steve.animation.py
└╴ steve.png.mcmeta
Metadata
Release files for mcanitexgen 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcanitexgen-1.2.3.tar.gz | 22.5 kB | Without provenance | Details for mcanitexgen-1.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcanitexgen-1.2.3-py3-none-any.whl | Python 3 | none | any | Details for mcanitexgen-1.2.3-py3-none-any.whl |
Total release size: 46.8 kB
Release files / mcanitexgen-1.2.3.tar.gz
| Download URL | mcanitexgen-1.2.3.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6fa6282569300f6b7ff48792b2d3abd5cd23b32db3df55d7700d3248ed58cbb
|
|
BLAKE2b-256 checksum How to use checksums |
adba32ab38dc172dc76d924b3fff72c53864540c5dc46a098f2d25559d7773bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / mcanitexgen-1.2.3-py3-none-any.whl
| Download URL | mcanitexgen-1.2.3-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c05c27d0d373a6d5ea239b7d34ebc02e01ea23c8e3f5fe350deaea7d4ac8d27a
|
|
BLAKE2b-256 checksum How to use checksums |
8839ba81f1c4e89d00420a3648309e0d0b95907031d8e193fa531569c4806381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Security for mcanitexgen 1.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.