refactor(tools): group the sixty scripts by what they talk to
One directory with sixty scripts stopped being navigable, and the grouping is also the sandbox boundary:
Tools/unreal/ commandlets and the two map builders, with ue_common.py and ue_placement.py as the
shared imports (they need the engine)
Tools/blender/ builders, exporters, the FBX preset, the MPFB character pipeline, blender_screenshots
(they need the Blender Flatpak)
Tools/review/ the visual loop: render_screenshots.sh, judge_screenshot.py, hero_compare.py,
build_comparison_md.py, e2e_asset_check.py, hero_iterate.sh, visual_loop.py,
visual_targets.json
Tools/gen/ image and texture generation: the ComfyUI driver, deterministic texture writers,
reference fetching
Tools/input/ OS-level input injection
root _common.py, check-lfs.sh, addon_compat_probe.py, sibling_asset_audit.py, tests/
Every moved script now resolves the repository root as ../.. and puts the tools root plus its siblings on
sys.path, so 'import ue_common' still works from unreal/. The test suite bootstrap does the same for the five
folders. render_screenshots.sh takes the folder as a third argument to run_cmdlet, and the e2e driver,
hero_iterate.sh and the comparison generator were repointed.
51 README rows now link to their new location, the README gains a Layout section naming each folder's
sandbox, and the architecture notes and Blender README follow the moves.
Verified: 108 tests pass, prettier is clean, judge_screenshot.py and hero_compare.py run from their new
homes, and the e2e run was aborted mid-way (it had been rebuilding an empty DemoMap for 15 minutes) and is
being rerun against the new layout.
This commit is contained in:
1 parent
f681d83736
commit
4d27109668
168 files changed
+799
-407
No files matched your search
@@ -0,0 +1,66 @@
|
||||
"""Remove the auto-generated simple collision from the site meshes, keeping their triangles.
|
||||
|
||||
<engine>/UnrealEditor-Cmd <uproject> -run=pythonscript \
|
||||
-script=<repo>/Tools/unreal/ue_clear_simple_collision.py -nullrhi -unattended -nopause -stdout
|
||||
|
||||
Why: the FBX import runs with `auto_generate_collision`, which adds ONE convex hull per mesh. For a
|
||||
279 m terrain or road that hull is a giant slab, and any *physics body* inside it - the Chaos vehicle -
|
||||
is pushed out of the hull every frame. Walked characters never notice, because character movement
|
||||
sweeps instead of resolving penetration, which is why the player was fine while the car was thrown
|
||||
into the air.
|
||||
|
||||
Clearing the hulls leaves `CTF_USE_COMPLEX_AS_SIMPLE`, so traces and physics use the real triangles.
|
||||
|
||||
Result: /tmp/gigline/clear-simple-collision.txt
|
||||
"""
|
||||
|
||||
import unreal
|
||||
|
||||
FOLDERS = ("/Game/Hollywood/Site", "/Game/Hollywood/Streets")
|
||||
RESULT = "/tmp/gigline/clear-simple-collision.txt"
|
||||
lines = []
|
||||
|
||||
|
||||
def log(message):
|
||||
lines.append(str(message))
|
||||
unreal.log(str(message))
|
||||
|
||||
|
||||
def main():
|
||||
cleared = 0
|
||||
for folder in FOLDERS:
|
||||
for path in unreal.EditorAssetLibrary.list_assets(folder, recursive=False):
|
||||
mesh = unreal.EditorAssetLibrary.load_asset(path)
|
||||
if not isinstance(mesh, unreal.StaticMesh):
|
||||
continue
|
||||
body = mesh.get_editor_property("body_setup")
|
||||
if body is None:
|
||||
continue
|
||||
agg = body.get_editor_property("agg_geom")
|
||||
convex = len(agg.get_editor_property("convex_elems"))
|
||||
boxes = len(agg.get_editor_property("box_elems"))
|
||||
if not convex and not boxes:
|
||||
continue
|
||||
agg.set_editor_property("convex_elems", [])
|
||||
agg.set_editor_property("box_elems", [])
|
||||
body.set_editor_property("agg_geom", agg)
|
||||
body.set_editor_property("collision_trace_flag",
|
||||
unreal.CollisionTraceFlag.CTF_USE_COMPLEX_AS_SIMPLE)
|
||||
mesh.set_editor_property("body_setup", body)
|
||||
unreal.EditorAssetLibrary.save_loaded_asset(mesh)
|
||||
log(f"{mesh.get_name()}: cleared {convex} convex, {boxes} box, complex-as-simple")
|
||||
cleared += 1
|
||||
lines.append(f"VERDICT: {'PASS' if cleared else 'NOTHING-TO-DO'}")
|
||||
log(f"{cleared} meshes cleared")
|
||||
|
||||
|
||||
try:
|
||||
main()
|
||||
except Exception as exc: # noqa: BLE001
|
||||
import traceback
|
||||
log(f"FAILED: {type(exc).__name__}: {exc}")
|
||||
log(traceback.format_exc())
|
||||
lines.append("VERDICT: FAIL")
|
||||
|
||||
with open(RESULT, "w") as f:
|
||||
f.write("\n".join(lines) + "\n")
|
||||
Reference in new issue
Block a user