This script automates rendering Project Zomboid models using Blender.
- Blender (tested with 4.0)
- Project Zomboid installation
vehicle_data.jsonfile containing vehicle mesh and texture paths. (A version is packaged with the script)- Obtained from pz-wiki_parser
- Tools > Vehicle render data
- Convert FBX files from ASCII format to binary. FBX Converter 2013 can be used (mirror)
model_data.jsonfile containing model mesh and textre paths. (A version is packaged with the script)- Obtained from pz-wiki_parser
- Script parser > model
- Open Blender.
- Paste the
vehicle_render.pyormodel_render.pyscript into the Text Editor in Scripting. - Adjust settings in the config section if needed:
MEDIA_PATH- should be the path of the media file in the Project Zomboid directory.MODEL_DATA_PATH- should be the path of the JSON data file.OUTPUT_PATH- where rendered images will be saved (default:./output).IS_SINGLE = True- render a single angle.Falsewill render each vehicle from 8 different angles.MODELS = ["Base.CarLuxury"]- only render selected models.
- Click Run Script (the play button in the Text Editor toolbar).
Note: Config (default values) can be modified as needed.
Run Blender in background by using:
blender --background --python vehicle_render.py
Or:
blender --background --python model_render.py
Arguments can be defined by adding them after --
is_single=true(Boolean) - If true, renders one angle instead of eight (default)render_engine=(String) -BLENDER_EEVEE(quick) orCYCLES(slow)dim=800(Integer) - Sets render dimension of both width and height.dim_xanddim_ycan used to define separately.
vehicles(List) - List each vehicle ID, separating with a comma (,).
Example:
blender --background --python vehicle_render.py -- is_single=true render_engine=BLENDER_EEVEE dim=800 vehicles=Base.CarNormal,Base.Van
models(List) - List each vehicle ID, separating with a comma (,).lens(Integer) - Focal length to be used for the render.cam(Integer) - Camera index with 45° intervals. (0 to 7)preset(String) - Option preset with differingFOCAL_LENGTHandCAM_INDEX.- Presets are broken up into 2 parts.
<lens>-<cam> <lens>- the focal length and can be any of the following:huge(200),large(400),med(600),small(1000),tiny(1600)<cam>- the camera index to use, in intervals of 2:0(0),1(2),2(4),3(6)
- Presets are broken up into 2 parts.
Example:
blender --background --python model_render.py -- preset=med-1 models=BeerBottleSixpack
- Ensure Blender is added to your system PATH
- Alternatively, include the Blender executable path in the command:
& "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe" --background --python vehicle_render.py
Rendered images are saved to the output/ folder beside the script (default). Ensure the full path is defined if running in Blender: Scripting.
Filenames follow the format:
CarLuxury_Model.png- single angleCarLuxury_Model.png, ...,CarLuxury_7_Model.png- full rotation
- Rendering all models at once will take a while. Be patient. If rendering in Blender it may indicate that it's stopped responding.
- There are several bathfiles with varying settings. These can be used to simplify using in the CLI.