"Fixing a source asset doesn't always trigger recompilation"
▸ SYMPTOM
You fix a broken .vmdl or .vmat source file, but the editor keeps showing the ERROR model (pink/checkerboard) or a white material. Restarting the editor doesn't help. The stale broken version persists.
▸ CAUSE
The engine's asset compiler has two independent staleness checks, and you need to defeat both:
-
Compiled artifact cache: The engine keeps serving the
_cfile (.vmdl_c,.vmat_c) baked from the broken version. Even across editor restarts, this stale compiled artifact is what gets loaded. -
Source mtime check: Deleting the
_cfile alone is not enough. If the source file's modification time hasn't changed (e.g., you only changed content but the filesystem didn't bump mtime, or you restored from a backup with the original timestamp), the engine sees the missing_c, checks the source mtime, concludes nothing changed, and reportsERROR_FILEOPENinstead of recompiling.
▸ FIX
Do both steps, then restart the editor:
-
Delete the compiled artifacts: remove the
.vmdl_c/.vmat_c/ any*generated*files for the asset. -
Touch the source file to update its mtime so the watcher marks it dirty:
# Manual fix
touch path/to/your_asset.vmdl
rm path/to/your_asset.vmdl_c
# Or in a Python pipeline script
import os
os.utime("path/to/your_asset.vmdl")
os.remove("path/to/your_asset.vmdl_c")Then open or restart the editor: the compiler will see a newer source mtime, a missing _c, and rebuild from the corrected source.
The reliable trigger: asset_compile per source file
Deleting the compiled _c on its own never queues a rebuild. The source stays indexed and nothing rebuilds, so the missing artifact just surfaces as an ERROR_FILEOPEN. Worse, the downstream symptoms can look like a test or harness bug rather than a stale-asset problem: a batch run that completes with zeroed telemetry, or a required asset that silently fails to load, with no compile error anywhere to point at the real cause.
Rather than relying on file deletion or a generic editor kick to make the compiler notice, poke the editor's own compile tool directly, once per source file:
asset_compile path/to/your_asset.vmdlThis asks the compiler to rebuild that specific source regardless of mtime or cache state, which is the most dependable way to clear a stale or failed bake.
▸ WHY IT WORKS
The asset compiler uses a two-gate system: the compiled _c must be missing or older than the source. Satisfying only one gate (deleting _c without touching the source, or editing the source while the old _c still exists) can leave the engine in a state where it doesn't trigger recompilation. Hitting both gates (no cached artifact AND a fresh source mtime) guarantees the compiler treats the asset as dirty and rebuilds it.
- Added: deleting a compiled _c alone never queues a rebuild. The source stays indexed and downstream symptoms can look like a test/harness bug. The reliable trigger is the editor's own asset_compile tool per source file.