What it does
godot-mog is a GDExtension addon that teaches Godot 4 how to read MoGen .mog source files.
When the editor sees a .mog file under res://, the addon parses it, lowers it through the same pipeline mogen build uses, exports a glTF binary in memory, and hands the bytes to Godot's GltfDocument. The result is saved as a PackedScene you can instance like any other .scn.
The same compile pipeline is exposed to GDScript as MogLoader, a RefCounted class — use this when you want to load a .mog file at runtime (from user://, downloaded content, or procedurally-generated source) without going through the editor importer.
Quick start
- Install the addon (drop the
addons/godot_mog/folder into your project, or enable from the asset library). - Open the project in Godot 4.3+.
- Enable
godot_mogunder Project → Project Settings → Plugins. - Drop any
.mogfile into the FileSystem dock — Godot imports it as aPackedSceneyou can drag into aNode3D.
Runtime API
var loader := MogLoader.new()
# Load from a Godot path (res:// or user://).
var scene: Node = loader.load_path("res://my_thing.mog")
if scene:
add_child(scene)
# Or compile a source string directly. `base_path` is the absolute filesystem
# directory used to resolve `use "…"` imports and `texture = "…"` paths.
var inline := """
meta (name = "x", version = "0.0", mogen_version = "0.1.5")
scene { box { size = (1, 1, 1) } }
"""
var node: Node = loader.load_source(inline, "")
load_path and load_source return null on failure; diagnostics go to the Output panel with a godot_mog [code] file: message prefix.
Compilation is synchronous and can be slow for CSG-heavy .mog files (Manifold isn't free). For latency-sensitive cases, call it on a worker thread — the extension is built with experimental-threads.
Requirements
- Godot 4.3 or later.
- Pre-built native libraries for Linux, macOS, and Windows are shipped in the release zip. To build from source you need a Rust toolchain plus
cmake(the CSG feature builds Google's Manifold C++ library on first build).
Links
- Source: https://github.com/krazyjakee/godot-mog
- MoGen (the upstream
.mogformat and tooling): https://moghub.org/download - License: MIT
Changelog for version v0.2.2
No changelog provided for this version.