Compile Meshes
Batch COLLADA (.dae) to compiled COLLADA (.cdae) converter for faster mesh loading. Used in build pipelines.
Batch COLLADA (.dae) to compiled COLLADA (.cdae) converter for faster mesh loading. Used in build pipelines.
Overview
util_compileMeshes finds all .dae files in configured directories, compiles them to .cdae format using compileCollada(), and optionally caches results via SHA1 hashing. Supports command-line arguments for customization. Designed for automated builds.
Extension path: lua/ge/extensions/util/compileMeshes.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
onExtensionLoaded | () | Starts the compilation job. |
work | (job) | Main compilation coroutine. |
Internals
Compile Paths
Default directories scanned for .dae files:
art/vehicles/levels/content//core/art/
Paths containing /DevTools/ or /projects/ are ignored.
Caching System
- Cache directory:
collada_cache/ - Each
.daefile is SHA1-hashed. If a matching.cdaeexists in cache, it's reused (hard-linked). - Cache hits/misses are tracked and reported.
- Produces
cdae_compilation_hardlink_todo.jsonfor post-processing.
Command-Line Arguments
| Argument | Effect |
|---|---|
-compileMeshesNoCache | Disables caching. |
-compileMeshesCustomPaths | Overrides compile paths (semicolon-separated). |
-compileMeshesNoCompileOnlyCheck | Only checks for existing CDAEs, does not compile. |
-compileMeshesNoCheck | Skips post-compilation verification. |
-compileMeshesScanPathBaseDirs | Also scans base dirs (not just subdirs). |
Compilation Steps
- Finds all
.daefiles in compile paths. - For each file, checks cache first.
- If not cached, loads materials for the directory and calls
compileCollada(src, dst, dstData, validateData). - Caches the result and logs progress.
- After completion, verifies all files were compiled.
- Shuts down with exit code 0 (success) or 1 (missed files).
How It Works
- Extension loads and starts a job with 1-second yield intervals.
- Materials are loaded per-directory to avoid name clashes.
- Each
.daeis compiled to.cdaewith optional caching. - Progress is logged every 3 seconds.
- Game shuts down when complete.
Lua Examples
-- Typically loaded via command-line, not called directly
-- The extension auto-starts compilation on load
-- Manual start (rare):
extensions.util_compileMeshes.work(job)Additional Exports
M.onExtensionLoaded- (undocumented)M.work- (undocumented)
Compile Imposters
Batch imposter compilation tool that iterates through levels and triggers imposter texture updates.
Config List Generator
Vehicle config list filtering and random selection system. Used for generating lists of vehicles that match specific criteria (e.g., for dealerships, traffic, career mode).