Display large images in Minetest [mt_poster_mod.py]

Post Reply
heger
New member
Posts: 3
Joined: Sat Aug 15, 2020 09:05

Display large images in Minetest [mt_poster_mod.py]

by heger » Post

[Update 2020-11-03]

usage: mt_poster_mod.py [-h] [--name NAME] [--res RES] [--top TOP] [--bottom BOTTOM] [--right RIGHT] [--left LEFT] [--back BACK] [--front FRONT]

This script creates a Minetest Mod and scheme files (MTS) to display images in a
Minetest world.

optional arguments:
-h, --help show this help message and exit
--name NAME name of the created Mod
--res RES resolution of the block tiles (default: 64x64px)
--top TOP image on the top of the blocks
--bottom BOTTOM image on the bottom of the blocks
--right RIGHT image on the right side of the blocks
--left LEFT image on the left side of the blocks
--back BACK image on the back of the blocks
--front FRONT image on the front of the blocks

Up to six given images (JPG, PNG,...) are split into tiles of RESxRESpx
(default: 64x64px) and placed on the sides of blocks. For best results all the
images should have the same size and both the image width and height should be a
multiple of RES.

If the image size is smaller than or equal to RESxRESpx the image will be used
'as is' for this side of the blocks.

If you do not provide any image for a side, this side will remain black.
If the image size is less or equal RESxRESpx, it is not split but used 'as is'
for all block tiles on this side.

The script creates a Mod containing all necessary blocks to compose the complete
image and writes it into the folder mods/NAME/. This folder contains:
- textures: A folder containing the PNG files for the tiles of the blocks.
- init.lua: Lua script that describes the blocks.
- mod.conf: Currently only contains the name of the Mod (NAME).

The default for NAME is poster_1, poster_2, ...

In addition to the Mod three Minetest scheme files are created in the folder
mods/NAME/schems/:
- top-bottom.mts: Contains a horizontal plate with the top image on the upper and the
bottom image on the lower side.
- right-left.mts: Contains a vertical plate with the right/left images.
- back-front.mts: Contains a vertical plate with the back/front images.

After you have installed the generated Mod in your Minetest world you can import
these MTS files using WorldEdit.

Python-mtschem from https://github.com/Gael-de-Sailly/python-mtschem is used to generate the MTS files.

viewtopic.php?t=9400 explains how to import a schematic file into your world.

WtSS_Screenshot.jpg
WtSS_Screenshot.jpg (655.96 KiB) Viewed 423 times
Attachments
mt_poster_mod.zip
(3.68 KiB) Downloaded 65 times

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests