Python + PyAutoGUI automation for batch-processing ZBrush .ztl assets.
This project was developed with assistance from AI prompting. Natural-language prompts were used to develop and iteratively refine the Python automation workflow, timing strategy, coordinate-based UI actions, documentation, and testing process.
- Batch processing of multiple
.ztlfiles - Automated LightBox closing and viewport preparation
- Edit mode and model framing
- SubTools panel preparation and scrolling
- PolyMesh3D conversion
- Decimation Master preprocessing
- Decimate Current
- Automatic full-screen screenshot after PolyMesh3D
- Automated ZTL Save As workflow
- Safe ZBrush closing without saving the original
- Keep-alive click after long waits
- PyAutoGUI emergency failsafe
Find ZTL files
↓
Open ZBrush file
↓
Close LightBox
↓
Prepare model / Edit / F
↓
SubTools + Scroll
↓
Make PolyMesh3D
↓
Wait + Screenshot
↓
Decimation Master
↓
Process Current
↓
Decimate Current
↓
Save As optimized ZTL
↓
Close ZBrush → No
↓
Next ZTL
- Python 3
- PyAutoGUI
- Pillow
- ZBrush
- Windows
Install Python 3, then run:
pip install -r requirements.txtBefore running, edit these variables in main.py:
INPUT_DIR = r"C:\Users\pc\Desktop\asdf"
OUTPUT_DIR = r"C:\Users\pc\Desktop\dfsd"Set them to your actual input and output folders.
python main.pyThe script displays the .ztl files it found and starts after a 5-second countdown.
PyAutoGUI's failsafe is enabled:
pyautogui.FAILSAFE = TrueMove the mouse to the top-left corner of the screen to trigger the failsafe.
For an input file:
head01.ztl
the output folder will contain:
head01.ztl
head01.png
The PNG is the full-screen screenshot captured after the PolyMesh3D step.
This project is screen-coordinate-based UI automation. The ZBrush window position, screen resolution, Windows display scaling, and ZBrush UI layout should remain consistent with the coordinates configured in main.py.
If the UI changes, recalibrate the coordinates before running a large batch.
The project demonstrates practical Python automation for a repetitive 3D production workflow, including GUI automation, batch processing, file handling, long-running task management, and safety controls.