Screenshot Creator (Vehicle Thumbnails)
M.dependencies = {"ui_imgui", "render_renderViews"}
Dependencies
M.dependencies = {"ui_imgui", "render_renderViews"}ImGui-based tool for batch-generating vehicle thumbnails and screenshots with configurable resolution, camera, and output options.
Overview
util_screenshotCreator provides a full GUI workflow for creating vehicle thumbnail images. It can batch-process all configs of selected vehicle models, procedurally frame the camera, support per-model or per-config manual camera overrides, and output to either the vehicle folder (as thumbnails) or a screenshots folder.
Extension path: lua/ge/extensions/util/screenshotCreator.lua
Dependencies: ui_imgui, render_renderViews
Exports (M)
| Function | Signature | Description |
|---|---|---|
openWindow | () | Opens the ImGui Screenshot Creator window. |
startWork | (workOptions?) | Starts the thumbnail generation coroutine. |
frameVehicle | (veh, fov, nearPlane, aspectRatio) → pos, rot | Computes a camera position that frames a vehicle's bounding box. |
onPreRender | (dt) | Drives the worker coroutine each frame. |
onUpdate | (dtReal, dtSim, dtRaw) | Renders the ImGui window. |
onExtensionLoaded | () | Populates vehicle GUI list, disables dynamic reflections in showroom. |
onExtensionUnloaded | () | Restores dynamic reflection settings. |
onSerialize | () → table | Saves window state for reload. |
onDeserialized | (data) | Restores window state after reload. |
Internals
Thumbnail Configuration
thumbnailConfig = {
fileEnding = ".jpg",
fov = 20,
nearPlane = 0.1,
}Default thumbnail resolution: 500 × 281 (preset index 2).
Preset Resolutions
720p, 1080p, Square (1920²), WQHD, UWQHD, 4K, 8K, and custom.
Camera System
Three camera sources (in priority order):
- Config camera - per-config manual offset stored in
/settings/thumbnailCameraConfig.json. - Model camera - per-model manual offset.
- Procedural camera -
frameVehicle()uses the vehicle's OBB to compute an optimal framing angle.
Camera offsets are stored relative to the vehicle's coordinate system and "rewound" to world space on use.
Work Options
{
selection = "selectedModels", -- or a specific config name
onlyMissingThumbnails = false,
}Output Destinations
"Vehicle thumbnails"- saves tovehicles/<model>/<config>.jpg"Screenshot/showroom folder"- saves toscreenshots/showroom/
Worker Coroutine
Runs in onPreRender, spawning vehicles one at a time, applying parking brake, disabling engine, and taking screenshots via render_renderViews.takeScreenshot().
How It Works
- Open the window via
openWindow(). - Select vehicle models in the "Models selection" tab.
- Configure output destination and resolution in the "Output" tab.
- Optionally set manual cameras in the "Manual controls" tab.
- Click play to start batch generation.
- Review results in the "Last run review" tab.
Lua Examples
-- Open the screenshot creator GUI
extensions.util_screenshotCreator.openWindow()
-- Start batch thumbnail generation programmatically
extensions.util_screenshotCreator.startWork({
selection = "selectedModels",
onlyMissingThumbnails = true,
})
-- Frame a vehicle for a custom screenshot
local pos, rot = extensions.util_screenshotCreator.frameVehicle(
getPlayerVehicle(0), 20, 0.1, 16/9
)Additional Exports
M.frameVehicle- (undocumented)M.onDeserialized- (undocumented)M.onExtensionLoaded- (undocumented)M.onExtensionUnloaded- (undocumented)M.onPreRender- (undocumented)M.onSerialize- (undocumented)M.onUpdate- (undocumented)M.openWindow- (undocumented)M.startWork- (undocumented)M.state- (undocumented)