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.
72 lines
2.4 KiB
Python
72 lines
2.4 KiB
Python
# Scale-test scene builder and FBX exporter for the Blender -> Unreal pipeline.
|
|
#
|
|
# Builds three 1 m cubes in the project geographic frame (EPSG:26911, origin
|
|
# Hollywood x Highland, X east / Y north / Z up):
|
|
# ScaleTest_A centred at (0, 0, 0.5) - origin + 1 m size reference
|
|
# ScaleTest_B centred at (10, 0, 0.5) - +10 m east probe
|
|
# ScaleTest_C centred at (0, 10, 0.5) - +10 m north probe
|
|
# and exports them as one FBX with the named export preset "ue_metric_v1".
|
|
#
|
|
# Run headless (see Art/blender/README.md for the Flatpak invocation):
|
|
# blender -b --factory-startup --python Tools/blender/scale_test_export.py -- \
|
|
# --out /tmp/gigline/scaletest.fbx --save-blend Art/blender/scaletest/scale-test-<date>.blend
|
|
|
|
import argparse
|
|
import os
|
|
import sys
|
|
|
|
import bpy
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
import fbx_export_preset as fbx_preset # noqa: E402
|
|
|
|
|
|
|
|
def build_scene():
|
|
scene = bpy.context.scene
|
|
for obj in list(bpy.data.objects):
|
|
bpy.data.objects.remove(obj, do_unlink=True)
|
|
|
|
mat = bpy.data.materials.new("M_ScaleTest_Red")
|
|
mat.use_nodes = True
|
|
bsdf = mat.node_tree.nodes.get("Principled BSDF")
|
|
bsdf.inputs["Base Color"].default_value = (0.8, 0.05, 0.05, 1.0)
|
|
|
|
specs = {
|
|
"ScaleTest_A": (0.0, 0.0, 0.5),
|
|
"ScaleTest_B": (10.0, 0.0, 0.5),
|
|
"ScaleTest_C": (0.0, 10.0, 0.5),
|
|
}
|
|
for name, loc in specs.items():
|
|
bpy.ops.mesh.primitive_cube_add(size=1.0, location=loc)
|
|
obj = bpy.context.active_object
|
|
obj.name = name
|
|
obj.data.materials.append(mat)
|
|
print(f"[scale_test] created {name} at {loc}")
|
|
|
|
|
|
def export_fbx(path):
|
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
# Named export preset "ue_metric_v1" - change only via a new preset name.
|
|
fbx_preset.export_static(path)
|
|
print(f"[scale_test] exported FBX preset ue_metric_v1 -> {path}")
|
|
|
|
|
|
def main():
|
|
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--out", default="/tmp/gigline/scaletest.fbx")
|
|
parser.add_argument("--save-blend", default=None)
|
|
args = parser.parse_args(argv)
|
|
|
|
build_scene()
|
|
|
|
if args.save_blend:
|
|
os.makedirs(os.path.dirname(args.save_blend), exist_ok=True)
|
|
bpy.ops.wm.save_as_mainfile(filepath=args.save_blend)
|
|
print(f"[scale_test] saved {args.save_blend}")
|
|
|
|
export_fbx(args.out)
|
|
|
|
|
|
main()
|