Skip to content

Command Line

Richard01CZ edited this page Sep 27, 2026 · 1 revision

Command Line — the MBT CLI

The same add-on, driven without a window: for converting a folder of files, putting it in a script, or handing a model to Blender from another program.

mbt.bat sits beside the add-on's own code, so it goes wherever the add-on goes. It finds Blender itself and needs no Python of its own.

mbt --install
mbt --install --textures "D:\Hry\Mafia Editovani\maps"
mbt --open "D:\models\tommy.4ds" --check
mbt --open "D:\models\tommy.4ds" --export "D:\out\tommy.4ds"
mbt --open "D:\models\tommy.4ds" --open "D:\anims\walk.5ds" --save scene.blend
mbt --open "D:\models\tommy.4ds" --gui
mbt --help

The arguments

Argument What it does
--install [ZIP or FOLDER] Installs the add-on into Blender and switches it on. With no name, it installs the copy the command itself came out of. With --textures, the texture folder is kept as well.
--open FILE Opens a .4ds, .5ds, .tck or .6ds, its kind read from the name. Repeat it to load an animation onto its model.
--export FILE Writes the scene out, its kind read from the name. Repeatable.
--save FILE.blend Saves the scene as a .blend.
--check, --check-animation Runs the export checks without writing anything.
--textures PATH The texture folder for this run.
--option NAME=VALUE A setting for the import or export dialog, named as it is there — selection_only, write_animation, and the rest. A name no dialog has is refused.
--gui Leaves Blender open with the result instead of closing it.
--blender PATH Which Blender to run in. MAFIA_BLENDER does the same.

Exit codes

Code Meaning
0 Everything asked for was done
1 A step was refused
2 The command itself made no sense
3 No Blender could be found

A zip and this file are a whole working copy

mbt.bat looks for the add-on's code beside itself, in an io_mafia_toolkit folder under it, or in a mafia-toolkit*.zip next to it — unpacking the zip where temporary files go and running from there. So a folder holding nothing but the zip and mbt.bat can install the add-on and open a model in one command, and can also open, check and export without installing anything at all.

Clone this wiki locally