fix(tools): importers clear the read-only LFS bit before saving; 0.1.3 docs refresh (#29)

Merged PR #29: v0.1.3 packaging and setup fixes

Co-authored-by: Zwitschi <zwitschi82@gmail.com>
This commit was merged in pull request #29.
This commit is contained in:
zwitschi authored and zwitschi committed 2026-11-08 18:53:48 +01:00
1 parent ba68dcfdbc
commit d6d3d54810
17 files changed
+323 -186

No files matched your search

+19
View File
@@ -15,6 +15,9 @@ import os
import unreal
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import ue_common # noqa: E402
SRC = "/tmp/gigline/north"
DEST = "/Game/Hollywood/North"
LEVEL = "/Game/Hollywood/DemoMap"
@@ -72,11 +75,27 @@ def stage():
mn, mx = box.min, box.max
log(f"{label}: mesh world-space X {mn.x:.0f}..{mx.x:.0f} Y {mn.y:.0f}..{mx.y:.0f} size "
f"{mx.x-mn.x:.0f}x{mx.y-mn.y:.0f} cm")
_make_map_writable(LEVEL)
saved = unreal.EditorLoadingAndSavingUtils.save_map(
unreal.EditorLevelLibrary.get_editor_world(), LEVEL)
log(f"save_map {LEVEL}: {saved}")
if not ue_common.require_saved(saved, LEVEL):
log(f"FAILED to save {LEVEL} — staged content will not persist")
def _make_map_writable(level: str) -> None:
"""Clear the read-only bit an LFS .umap checks out with.
Without this `save_map()` returns False and the staged actor is lost on the
next load — no exception, no non-zero exit (see MEMORY: 0.1.x trap).
"""
content = unreal.Paths.project_content_dir()
rel = level[len("/Game/"):] if level.startswith("/Game/") else level
umap = os.path.join(content, rel + ".umap")
note = ue_common.make_writable(umap)
if note:
log(f"map writable: {note}")
def main():
for fn, asset_name in IMPORTS:
task = unreal.AssetImportTask()