Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(verse): add the deck levels, collision channels and the test human skeleton (#1123)
Ruben Lütke9130f2665de4
diff --git a/scripts/unreal/g0/editor_content.py b/scripts/unreal/g0/editor_content.pynew file mode 100644index 0000000000..93fbb2bd37--- /dev/null+++ b/scripts/unreal/g0/editor_content.py@@ -0,0 +1,290 @@+"""Create and verify the G0.8 deck maps and the G0.9 test skeleton (editor Python).++Runs inside the headless editor's ``pythonscript`` commandlet, started by+``scripts/unreal/g0_content.py``. Environment:++* ``VERSE_G0_MODE``: ``build`` (create what is missing, then verify) or ``verify``.+* ``VERSE_G0_FBX``: the FBX the Blender step exported (build mode only).++Idempotent: an existing map, data layer or mesh is kept, never re-saved, so a+rerun does not churn LFS objects. Delete an asset first to rebuild it. Every+result line starts with ``VERSE_G0``; the last one is ``VERSE_G0 OK`` or+``VERSE_G0 FAIL``.+"""++from __future__ import annotations++import os+import traceback++import unreal++DECKS = {+ "Bridge": ("Base",),+ "Ops": ("Base",),+ "Engineering": ("Base",),+ "Hangar": ("Base", "Day", "Arena"),+}+# Day-to-day state on load: the hangar is a normal deck; the arena switch+# (VerseDecks, FVerseArenaSwitchEvent) activates DL_Hangar_Arena on demand.+INITIAL_STATE = {"Base": "ACTIVATED", "Day": "ACTIVATED", "Arena": "UNLOADED"}++TEST_DIR = "/Game/Verse/Test/G0"+MESH = "SK_Test_Human"+SKELETON = "SKEL_Test_Human"+PHYSICS = "PHYS_Test_Human"++# Hit zones of art-pipeline 12.1 (architecture 3.3): (bone, capsule end bone or+# None to continue along the parent direction, radius in cm). Hips is the root body.+HIT_BODIES = (+ ("Hips", "Spine_01", 13.0),+ ("Spine_01", "Spine_03", 14.0), # lower torso+ ("Spine_03", "Neck", 16.0), # upper torso+ ("Neck", "Head", 6.0),+ ("Head", None, 11.0),+ ("UpperArm_L", "LowerArm_L", 6.0),+ ("UpperArm_R", "LowerArm_R", 6.0),+ ("LowerArm_L", "Hand_L", 5.0),+ ("LowerArm_R", "Hand_R", 5.0),+ ("Thigh_L", "Calf_L", 8.0),+ ("Thigh_R", "Calf_R", 8.0),+ ("Calf_L", "Foot_L", 6.0),+ ("Calf_R", "Foot_R", 6.0),+)++ASSETS = unreal.EditorAssetLibrary+FAILURES: list[str] = []+++def say(msg: str) -> None:+ unreal.log(f"VERSE_G0 {msg}")+++def fail(msg: str) -> None:+ FAILURES.append(msg)+ unreal.log_error(f"VERSE_G0 FAIL {msg}")+++def map_path(deck: str) -> str:+ return f"/Game/Verse/Decks/{deck}/LV_{deck}"+++def layer_path(deck: str, layer: str) -> str:+ return f"/Game/Verse/Decks/{deck}/DataLayers/DL_{deck}_{layer}"+++# ---------------------------------------------------------------- G0.8 levels+++def ensure_layer_asset(deck: str, layer: str) -> unreal.DataLayerAsset:+ path = layer_path(deck, layer)+ if ASSETS.does_asset_exist(path):+ return ASSETS.load_asset(path)+ folder, name = path.rsplit("/", 1)+ tools = unreal.AssetToolsHelpers.get_asset_tools()+ asset = tools.create_asset(name, folder, unreal.DataLayerAsset, unreal.DataLayerFactory())+ asset.set_editor_property("data_layer_type", unreal.DataLayerType.RUNTIME)+ ASSETS.save_loaded_asset(asset, only_if_is_dirty=False)+ say(f"created {path}")+ return asset+++def ensure_level(deck: str) -> None:+ path = map_path(deck)+ assets = [ensure_layer_asset(deck, layer) for layer in DECKS[deck]]+ if ASSETS.does_asset_exist(path):+ say(f"kept {path}")+ return+ levels = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ if not levels.new_level(path, is_partitioned_world=True):+ fail(f"new_level {path}")+ return+ layers = unreal.get_editor_subsystem(unreal.DataLayerEditorSubsystem)+ for layer, asset in zip(DECKS[deck], assets, strict=True):+ params = unreal.DataLayerCreationParameters()+ params.set_editor_property("data_layer_asset", asset)+ instance = layers.create_data_layer_instance(params)+ if instance is None:+ fail(f"data layer instance DL_{deck}_{layer}")+ continue+ state = getattr(unreal.DataLayerRuntimeState, INITIAL_STATE[layer])+ layers.set_data_layer_initial_runtime_state(instance, state)+ if not levels.save_current_level():+ fail(f"save {path}")+ return+ say(f"created {path}")+++def verify_level(deck: str) -> None:+ path = map_path(deck)+ if not ASSETS.does_asset_exist(path):+ fail(f"missing {path}")+ return+ levels = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem)+ if not levels.load_level(path):+ fail(f"load {path}")+ return+ world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()+ settings = world.get_world_settings()+ if settings.get_editor_property("world_partition") is None:+ fail(f"{path} is not World Partition")+ layers = unreal.get_editor_subsystem(unreal.DataLayerEditorSubsystem)+ found = {}+ for instance in layers.get_all_data_layers():+ asset = instance.get_editor_property("data_layer_asset") \+ if hasattr(instance, "data_layer_asset") else instance.get_asset()+ if asset is not None:+ found[asset.get_name()] = instance+ for layer in DECKS[deck]:+ name = f"DL_{deck}_{layer}"+ instance = found.get(name)+ if instance is None:+ fail(f"{path} lacks data layer {name}")+ continue+ if not instance.is_runtime():+ fail(f"{name} is not a runtime layer")+ state = instance.get_initial_runtime_state()+ want = getattr(unreal.DataLayerRuntimeState, INITIAL_STATE[layer])+ if state != want:+ fail(f"{name} initial state {state}, want {want}")+ say(f"verified {path} layers={sorted(found)}")+++# ----------------------------------------------------------- G0.9 test human+++def import_test_human(fbx: str) -> None:+ mesh_path = f"{TEST_DIR}/{MESH}"+ if ASSETS.does_asset_exist(mesh_path):+ say(f"kept {mesh_path}")+ return+ if not fbx or not os.path.isfile(fbx):+ fail(f"FBX not found: {fbx}")+ return+ # The Interchange importer syncs the Content Browser (Slate) after import,+ # which asserts in a commandlet; the classic FBX factory does not.+ unreal.SystemLibrary.execute_console_command(None, "Interchange.FeatureFlags.Import.FBX 0")+ options = unreal.FbxImportUI()+ options.set_editor_property("import_as_skeletal", True)+ options.set_editor_property("import_mesh", True)+ options.set_editor_property("import_materials", False)+ options.set_editor_property("import_textures", False)+ options.set_editor_property("import_animations", False)+ options.set_editor_property("create_physics_asset", False)+ options.set_editor_property("mesh_type_to_import", unreal.FBXImportType.FBXIT_SKELETAL_MESH)+ task = unreal.AssetImportTask()+ task.set_editor_property("filename", fbx)+ task.set_editor_property("destination_path", TEST_DIR)+ task.set_editor_property("destination_name", MESH)+ task.set_editor_property("automated", True)+ task.set_editor_property("replace_existing", True)+ task.set_editor_property("save", False)+ task.set_editor_property("options", options)+ unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([task])+ imported = [p for p in task.get_editor_property("imported_object_paths")]+ say(f"imported {imported}")+ mesh = ASSETS.load_asset(mesh_path)+ if not isinstance(mesh, unreal.SkeletalMesh):+ fail(f"import produced no skeletal mesh at {mesh_path}: {imported}")+ return+ rename_skeleton(mesh)+ build_physics(mesh)+ for path in ASSETS.list_assets(TEST_DIR, recursive=True, include_folder=False):+ ASSETS.save_asset(path, only_if_is_dirty=False)+++def rename_skeleton(mesh: unreal.SkeletalMesh) -> None:+ skeleton = mesh.get_editor_property("skeleton")+ old = skeleton.get_path_name().split(".")[0]+ new = f"{TEST_DIR}/{SKELETON}"+ if old == new:+ return+ if not ASSETS.rename_asset(old, new):+ fail(f"rename {old} -> {new}")+ return+ fix_redirectors()+++def fix_redirectors() -> None:+ registry = unreal.AssetRegistryHelpers.get_asset_registry()+ redirectors = []+ for data in registry.get_assets_by_path(TEST_DIR, recursive=True):+ if str(data.asset_class_path.asset_name) == "ObjectRedirector":+ redirectors.append(data.get_asset())+ if redirectors:+ unreal.AssetToolsHelpers.get_asset_tools().fixup_referencers(redirectors)+ for data in registry.get_assets_by_path(TEST_DIR, recursive=True):+ if str(data.asset_class_path.asset_name) == "ObjectRedirector":+ ASSETS.delete_asset(str(data.package_name))+++def build_physics(mesh: unreal.SkeletalMesh) -> None:+ """Create PHYS_Test_Human and give it exactly the HIT_BODIES capsules.++ The engine generator only creates the asset; its automatic bodies weld the+ thin placeholder boxes away, so UVerseContentTools replaces them.+ """+ path = f"{TEST_DIR}/{PHYSICS}"+ meshes = unreal.get_editor_subsystem(unreal.SkeletalMeshEditorSubsystem)+ meshes.create_physics_asset(mesh)+ physics = mesh.get_editor_property("physics_asset")+ if physics is None:+ fail(f"physics asset for {MESH}")+ return+ old = physics.get_path_name().split(".")[0]+ if old != path:+ if not ASSETS.rename_asset(old, path):+ fail(f"rename {old} -> {path}")+ return+ fix_redirectors()+ physics = ASSETS.load_asset(path)+ ok = unreal.VerseContentTools.rebuild_hit_bodies(+ physics, mesh,+ [unreal.Name(b) for b, _, _ in HIT_BODIES],+ [unreal.Name(e or "None") for _, e, _ in HIT_BODIES],+ [r for _, _, r in HIT_BODIES],+ )+ if not ok:+ fail(f"hit bodies for {path}")+ return+ say(f"created {path} with {len(HIT_BODIES)} hit bodies")+++def verify_test_human() -> None:+ mesh_path = f"{TEST_DIR}/{MESH}"+ if not ASSETS.does_asset_exist(mesh_path):+ fail(f"missing {mesh_path}")+ return+ mesh = ASSETS.load_asset(mesh_path)+ # Centimetres in Unreal (art-pipeline 12.1): the placeholder stands about 1.8 m tall.+ height = mesh.get_bounds().box_extent.z * 2.0+ if not 170.0 <= height <= 190.0:+ fail(f"{MESH} is {height:.2f} units tall, want about 181 cm")+ skeleton = mesh.get_editor_property("skeleton")+ if skeleton is None or skeleton.get_name() != SKELETON:+ fail(f"skeleton is {skeleton.get_name() if skeleton else None}, want {SKELETON}")+ physics = mesh.get_editor_property("physics_asset")+ if physics is None or physics.get_name() != PHYSICS:+ fail(f"physics asset is {physics.get_name() if physics else None}, want {PHYSICS}")+ say(f"verified {mesh_path}")+++# ---------------------------------------------------------------------- main+++def main() -> None:+ mode = os.environ.get("VERSE_G0_MODE", "verify")+ try:+ if mode == "build":+ for deck in DECKS:+ ensure_level(deck)+ import_test_human(os.environ.get("VERSE_G0_FBX", ""))+ for deck in DECKS:+ verify_level(deck)+ verify_test_human()+ except Exception: # noqa: BLE001 - report and fail the run, never hang the editor+ fail(traceback.format_exc())+ say("FAIL" if FAILURES else "OK")+++main()diff --git a/scripts/unreal/g0/test_human_blender.py b/scripts/unreal/g0/test_human_blender.pynew file mode 100644index 0000000000..a1e014e3ed--- /dev/null+++ b/scripts/unreal/g0/test_human_blender.py@@ -0,0 +1,217 @@+"""Build the SK_Test_Human placeholder in Blender and export it as FBX (G0.9).++Runs inside Blender (``blender -b --factory-startup -P <this> -- <out.fbx>``);+``scripts/unreal/g0_content.py`` calls it. The skeleton carries every frozen+bone name of ``docs/verse/unreal/contracts/art-pipeline.md`` 12.1 in the+hierarchy given there. The mesh is crude on purpose: one box per body bone,+rigidly skinned, so movement, combat and gore tests have hit zones and bones+to address before the real rig (WP13) lands. A-pose, origin on the floor+between the feet, character facing -Y in Blender (Unreal +X after import).++The FBX goes to an ignored cache; only the imported ``.uasset`` is committed.+"""++from __future__ import annotations++import math+import sys++import bpy+from mathutils import Vector++# (name, parent, head, tail) in metres. Left side is +X (the character faces -Y).+BONES: list[tuple[str, str | None, tuple[float, float, float], tuple[float, float, float]]] = []++# Body bones that get a box in the placeholder mesh: name -> box half-size across the bone.+BOX_HALF_WIDTH: dict[str, float] = {}+++def bone(name, parent, head, tail, box=None):+ BONES.append((name, parent, head, tail))+ if box is not None:+ BOX_HALF_WIDTH[name] = box+++def _along(start, direction, length):+ return tuple(s + d * length for s, d in zip(start, direction, strict=True))+++def build_bone_table() -> None:+ bone("Root", None, (0, 0, 0), (0, 0, 0.1))+ bone("Hips", "Root", (0, 0, 0.95), (0, 0, 1.05), box=0.16)+ bone("Spine_01", "Hips", (0, 0, 1.05), (0, 0, 1.20), box=0.15)+ bone("Spine_02", "Spine_01", (0, 0, 1.20), (0, 0, 1.35), box=0.16)+ bone("Spine_03", "Spine_02", (0, 0, 1.35), (0, 0, 1.48), box=0.17)+ # Wide neck box: the engine's physics asset generator welds bodies under+ # 20 cm into their parent, and the neck is a hit zone of its own.+ bone("Neck", "Spine_03", (0, 0, 1.48), (0, 0, 1.58), box=0.11)+ bone("Head", "Neck", (0, 0, 1.58), (0, 0, 1.80), box=0.10)+ bone("Camera", "Head", (0, -0.10, 1.68), (0, -0.20, 1.68))++ # A-pose: upper arms 45 degrees down from horizontal.+ down = math.radians(45.0)+ for side, sx in (("L", 1.0), ("R", -1.0)):+ arm_dir = (sx * math.cos(down), 0.0, -math.sin(down))+ shoulder = (sx * 0.17, 0.0, 1.44)+ elbow = _along(shoulder, arm_dir, 0.28)+ wrist = _along(elbow, arm_dir, 0.26)+ palm = _along(wrist, arm_dir, 0.08)+ bone(f"Clavicle_{side}", "Spine_03", (sx * 0.03, 0, 1.44), shoulder, box=0.04)+ bone(f"UpperArm_{side}", f"Clavicle_{side}", shoulder, elbow, box=0.05)+ bone(+ f"UpperArm_Twist_{side}", f"UpperArm_{side}",+ _along(shoulder, arm_dir, 0.14), _along(shoulder, arm_dir, 0.20),+ )+ bone(f"LowerArm_{side}", f"UpperArm_{side}", elbow, wrist, box=0.04)+ bone(+ f"LowerArm_Twist_{side}", f"LowerArm_{side}",+ _along(elbow, arm_dir, 0.18), _along(elbow, arm_dir, 0.24),+ )+ bone(f"Hand_{side}", f"LowerArm_{side}", wrist, palm, box=0.035)+ # Fingers spread across the palm along Y; the thumb starts at the wrist, forward.+ for finger, y in (("Index", -0.03), ("Middle", -0.01), ("Ring", 0.01), ("Pinky", 0.03)):+ start = (palm[0], palm[1] + y, palm[2])+ parent = f"Hand_{side}"+ for j in (1, 2, 3):+ end = _along(start, arm_dir, 0.03)+ name = f"{finger}_0{j}_{side}"+ bone(name, parent, start, end, box=0.008)+ parent, start = name, end+ thumb_dir = (arm_dir[0] * 0.5, -0.8, arm_dir[2] * 0.5)+ start = _along(wrist, arm_dir, 0.02)+ start = (start[0], start[1] - 0.03, start[2])+ parent = f"Hand_{side}"+ for j in (1, 2, 3):+ end = _along(start, thumb_dir, 0.03)+ name = f"Thumb_0{j}_{side}"+ bone(name, parent, start, end, box=0.009)+ parent, start = name, end+ grip = _along(wrist, arm_dir, 0.05)+ bone(f"Weapon_{side}", f"Hand_{side}", grip, (grip[0], grip[1] - 0.10, grip[2]))++ hip = (sx * 0.10, 0.0, 0.95)+ knee = (sx * 0.10, 0.0, 0.52)+ ankle = (sx * 0.10, 0.0, 0.10)+ ball = (sx * 0.10, -0.12, 0.03)+ toe = (sx * 0.10, -0.20, 0.03)+ bone(f"Thigh_{side}", "Hips", hip, knee, box=0.08)+ bone(f"Thigh_Twist_{side}", f"Thigh_{side}", (hip[0], 0, 0.80), (hip[0], 0, 0.70))+ bone(f"Calf_{side}", f"Thigh_{side}", knee, ankle, box=0.06)+ bone(f"Calf_Twist_{side}", f"Calf_{side}", (knee[0], 0, 0.30), (knee[0], 0, 0.20))+ bone(f"Foot_{side}", f"Calf_{side}", ankle, ball, box=0.05)+ bone(f"Ball_{side}", f"Foot_{side}", ball, toe, box=0.04)++ # IK bones follow their FK targets; at rest they sit on them.+ bone("IK_Foot_Root", "Root", (0, 0, 0), (0, 0, 0.1))+ bone("IK_Hand_Root", "Root", (0, 0, 0), (0, 0, 0.1))+ tails = {name: (head, tail) for name, _, head, tail in BONES}+ for side in ("L", "R"):+ head, tail = tails[f"Foot_{side}"]+ bone(f"IK_Foot_{side}", "IK_Foot_Root", head, tail)+ gun_head, gun_tail = tails["Hand_R"]+ bone("IK_Hand_Gun", "IK_Hand_Root", gun_head, gun_tail)+ for side in ("L", "R"):+ head, tail = tails[f"Hand_{side}"]+ bone(f"IK_Hand_{side}", "IK_Hand_Gun", head, tail)+++def reset_scene() -> None:+ bpy.ops.wm.read_factory_settings(use_empty=True)+ scene = bpy.context.scene+ scene.unit_settings.system = "METRIC"+ scene.unit_settings.scale_length = 1.0+++def build_armature() -> bpy.types.Object:+ data = bpy.data.armatures.new("SKEL_Test_Human")+ # Named "Armature" so the Unreal importer drops the object node and Root is the top bone.+ rig = bpy.data.objects.new("Armature", data)+ bpy.context.scene.collection.objects.link(rig)+ bpy.context.view_layer.objects.active = rig+ rig.select_set(True)+ bpy.ops.object.mode_set(mode="EDIT")+ edit = data.edit_bones+ for name, parent, head, tail in BONES:+ eb = edit.new(name)+ eb.head = Vector(head)+ eb.tail = Vector(tail)+ eb.roll = 0.0+ eb.use_deform = True+ if parent:+ eb.parent = edit[parent]+ eb.use_connect = False+ bpy.ops.object.mode_set(mode="OBJECT")+ return rig+++def build_mesh(rig: bpy.types.Object) -> bpy.types.Object:+ verts: list[Vector] = []+ faces: list[tuple[int, int, int, int]] = []+ owner: list[str] = []+ quads = ((0, 1, 2, 3), (7, 6, 5, 4), (0, 4, 5, 1), (1, 5, 6, 2), (2, 6, 7, 3), (3, 7, 4, 0))+ for name, _, head, tail in BONES:+ half = BOX_HALF_WIDTH.get(name)+ if half is None:+ continue+ h, t = Vector(head), Vector(tail)+ axis = (t - h).normalized()+ helper = Vector((0, 0, 1)) if abs(axis.z) < 0.9 else Vector((0, 1, 0))+ u = axis.cross(helper).normalized() * half+ v = axis.cross(u).normalized() * half+ base = len(verts)+ for end in (h, t):+ verts.extend([end + u + v, end - u + v, end - u - v, end + u - v])+ faces.extend(tuple(base + i for i in q) for q in quads)+ owner.extend([name] * 8)+ mesh = bpy.data.meshes.new("SK_Test_Human")+ mesh.from_pydata([tuple(p) for p in verts], [], faces)+ mesh.validate()+ mesh.update()+ obj = bpy.data.objects.new("SK_Test_Human", mesh)+ bpy.context.scene.collection.objects.link(obj)+ groups = {}+ for index, name in enumerate(owner):+ group = groups.get(name) or obj.vertex_groups.new(name=name)+ groups[name] = group+ group.add([index], 1.0, "REPLACE")+ obj.parent = rig+ mod = obj.modifiers.new("Armature", "ARMATURE")+ mod.object = rig+ return obj+++def export(path: str) -> None:+ bpy.ops.object.select_all(action="SELECT")+ bpy.ops.export_scene.fbx(+ filepath=path,+ use_selection=True,+ object_types={"ARMATURE", "MESH"},+ apply_unit_scale=True,+ apply_scale_options="FBX_SCALE_NONE",+ mesh_smooth_type="FACE",+ add_leaf_bones=False,+ use_armature_deform_only=False,+ primary_bone_axis="Y",+ secondary_bone_axis="X",+ bake_anim=False,+ path_mode="STRIP",+ embed_textures=False,+ )+++def main() -> None:+ argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []+ if not argv:+ raise SystemExit(+ "usage: blender -b --factory-startup -P test_human_blender.py -- <out.fbx>"+ )+ build_bone_table()+ reset_scene()+ rig = build_armature()+ build_mesh(rig)+ export(argv[0])+ print(f"VERSE_G0 exported {len(BONES)} bones to {argv[0]}")+++if __name__ == "__main__":+ main()diff --git a/scripts/unreal/g0_content.py b/scripts/unreal/g0_content.pynew file mode 100644index 0000000000..3f61041d85--- /dev/null+++ b/scripts/unreal/g0_content.py@@ -0,0 +1,107 @@+#!/usr/bin/env python3+"""Regenerate the G0.8 and G0.9 Unreal content from code.++G0.8: the empty World Partition deck maps ``LV_Bridge``, ``LV_Ops``,+``LV_Engineering`` and ``LV_Hangar`` (One File Per Actor on) with their data+layers ``DL_<Deck>_Base`` plus ``DL_Hangar_Day`` and ``DL_Hangar_Arena``.+G0.9: the ``SK_Test_Human`` placeholder skeleton with the frozen bone names of+``docs/verse/unreal/contracts/art-pipeline.md`` 12.1.++Steps, each optional:++1. ``blender``: build the placeholder in Blender and export an FBX into the+ ignored cache ``art/verse/.cache/unreal/g0/`` (never committed).+2. ``editor``: run ``g0/editor_content.py`` in the headless editor's+ ``pythonscript`` commandlet (``-nullrhi``), which creates the maps and data+ layers, imports the FBX and verifies everything. Only the resulting+ ``.uasset``/``.umap`` files are committed, through Git LFS.++ python scripts/unreal/g0_content.py # both steps+ python scripts/unreal/g0_content.py --step editor # maps and import only+ python scripts/unreal/g0_content.py --verify-only # check, change nothing++The editor must be compiled first (``Build.bat VerseEditor Win64 Development``).+Never run it while another editor holds the project.+"""++from __future__ import annotations++import argparse+import os+import subprocess+import sys+from pathlib import Path++REPO_ROOT = Path(__file__).resolve().parents[2]+PROJECT = REPO_ROOT / "unreal" / "Verse" / "Verse.uproject"+HERE = Path(__file__).resolve().parent / "g0"+FBX = REPO_ROOT / "art" / "verse" / ".cache" / "unreal" / "g0" / "SK_Test_Human.fbx"+DEFAULT_ENGINE = Path("C:/Program Files/Epic Games/UE_5.7")+DEFAULT_BLENDER = Path("C:/Program Files/Blender Foundation/Blender 5.0/blender.exe")+++def _engine_root() -> Path:+ return Path(os.environ.get("VERSE_UE_ROOT", DEFAULT_ENGINE))+++def _blender() -> Path:+ return Path(os.environ.get("VERSE_BLENDER", DEFAULT_BLENDER))+++def run_blender() -> None:+ FBX.parent.mkdir(parents=True, exist_ok=True)+ cmd = [+ str(_blender()), "-b", "--factory-startup",+ "-P", str(HERE / "test_human_blender.py"), "--", str(FBX),+ ]+ out = subprocess.run(cmd, capture_output=True, text=True, check=False) # noqa: S603+ if out.returncode != 0 or "VERSE_G0 exported" not in out.stdout:+ sys.stderr.write(out.stdout[-4000:] + out.stderr[-4000:])+ raise SystemExit("blender step failed")+ print(next(ln for ln in out.stdout.splitlines() if "VERSE_G0" in ln))+++def run_editor(verify_only: bool, log: Path) -> None:+ editor = _engine_root() / "Engine" / "Binaries" / "Win64" / "UnrealEditor-Cmd.exe"+ script = HERE / "editor_content.py"+ env = dict(os.environ)+ env["VERSE_G0_FBX"] = str(FBX)+ env["VERSE_G0_MODE"] = "verify" if verify_only else "build"+ cmd = [+ str(editor), str(PROJECT),+ "-run=pythonscript", f"-script={script}",+ "-nullrhi", "-unattended", "-nosplash", "-NoSound", "-nop4",+ f"-abslog={log}",+ ]+ out = subprocess.run( # noqa: S603+ cmd, env=env, check=False, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,+ )+ text = log.read_text(encoding="utf-8", errors="replace") if log.exists() else ""+ marks = [ln for ln in text.splitlines() if "VERSE_G0" in ln]+ for ln in marks:+ print(ln.split("LogPython: ", 1)[-1])+ if out.returncode != 0 or not any("VERSE_G0 OK" in ln for ln in marks):+ raise SystemExit(f"editor step failed (exit {out.returncode}); log: {log}")+++def main() -> int:+ parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])+ parser.add_argument("--step", choices=("all", "blender", "editor"), default="all")+ parser.add_argument("--verify-only", action="store_true")+ parser.add_argument("--log", type=Path,+ default=REPO_ROOT / "unreal" / "Verse" / "Saved" / "g0_content.log")+ args = parser.parse_args()+ if args.verify_only:+ run_editor(True, args.log)+ return 0+ if args.step in ("all", "blender"):+ run_blender()+ if args.step in ("all", "editor"):+ if not FBX.exists():+ raise SystemExit(f"missing {FBX}; run --step blender first")+ run_editor(False, args.log)+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/unreal/Verse/Config/DefaultEngine.ini b/unreal/Verse/Config/DefaultEngine.iniindex 9afaae4c0b..b422179f03 100644--- a/unreal/Verse/Config/DefaultEngine.ini+++ b/unreal/Verse/Config/DefaultEngine.ini@@ -27,3 +27,25 @@ ConnectionType=USBOnlybUseManualIPAddress=FalseManualIPAddress=++; Verse collision (G0.8). Channel names are frozen in contracts/destruction.md,+; profile names in contracts/art-pipeline.md section 5. Code addresses them only+; through Source/VerseCore/Public/VerseCollision.h; the slot order below is+; frozen with it (Verse.Core.Collision checks both match).+[/Script/Engine.CollisionProfile]++DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="VerseBolt")++DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="VerseSight")++DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="VerseHitBody")++DefaultChannelResponses=(Channel=ECC_GameTraceChannel4,DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False,Name="VerseDebris")++Profiles=(Name="Verse_Architecture",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=(),HelpMessage="Walls, floors, stairs, catwalks, columns. Blocks pawns, bolts, sight and debris.")++Profiles=(Name="Verse_Destructible",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=(),HelpMessage="Breakable pieces; the server swaps the per-state proxy. Bolts penetrate per DA_PenetrationTable.")++Profiles=(Name="Verse_Glass",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="VerseSight",Response=ECR_Overlap)),HelpMessage="Glazing. Blocks pawns and bolts (and breaks); sight sees through it but multi traces report it.")++Profiles=(Name="Verse_Prop",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=(),HelpMessage="Props over 30 cm.")++Profiles=(Name="Verse_PropSmall",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="Props under 30 cm in every axis. Ignored by pawns so clutter never snags movement; bolts still hit it.")++Profiles=(Name="Verse_Debris",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="VerseDebris",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="VerseBolt",Response=ECR_Ignore),(Channel="VerseSight",Response=ECR_Ignore),(Channel="VerseHitBody",Response=ECR_Ignore)),HelpMessage="Geometry collection chunks, client side only. Never affects gameplay.")++Profiles=(Name="Verse_ProxyOnly",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="Hidden proxy meshes of destructible pieces; the server sets the per-state response.")++Profiles=(Name="Verse_NoCollision",CollisionEnabled=NoCollision,bCanModify=False,ObjectTypeName="WorldStatic",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="VerseBolt",Response=ECR_Ignore),(Channel="VerseSight",Response=ECR_Ignore),(Channel="VerseDebris",Response=ECR_Ignore)),HelpMessage="Decals, cables, light cards.")+; Pawn capsules: bolts, sight and hit traces pass through to the per-bone hit bodies; debris ignores pawns.++EditProfiles=(Name="Pawn",CustomResponses=((Channel="VerseBolt",Response=ECR_Ignore),(Channel="VerseSight",Response=ECR_Ignore),(Channel="VerseHitBody",Response=ECR_Ignore),(Channel="VerseDebris",Response=ECR_Ignore)))+; Character meshes carry the PHYS_ hit bodies: the only thing VerseHitBody hits.++EditProfiles=(Name="CharacterMesh",CustomResponses=((Channel="VerseHitBody",Response=ECR_Block),(Channel="VerseBolt",Response=ECR_Ignore),(Channel="VerseSight",Response=ECR_Ignore),(Channel="VerseDebris",Response=ECR_Ignore)))diff --git a/unreal/Verse/Content/Verse/Decks/Bridge/DataLayers/DL_Bridge_Base.uasset b/unreal/Verse/Content/Verse/Decks/Bridge/DataLayers/DL_Bridge_Base.uassetnew file mode 100644index 0000000000..2ac047a6aa--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Bridge/DataLayers/DL_Bridge_Base.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:0ffd9803a969c1e890ccf75a8a1ab3fbe1197840da3c8c48133d1103037eca1d+size 1421diff --git a/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge.umap b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge.umapnew file mode 100644index 0000000000..85a722ae08--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge.umap@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:25b8f32478ba52442634887d24e073f6e6abb7efdf6d398eaf7aed426fddc2ed+size 11032diff --git a/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Instanced.uasset b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Instanced.uassetnew file mode 100644index 0000000000..1167ffd3d4--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Instanced.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:d05d2cb5c106a8f0a49481ed0c452bb697a17f3221ed56e23b47fbcf0f793530+size 1747diff --git a/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Merged.uasset b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Merged.uassetnew file mode 100644index 0000000000..b42427c55e--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Bridge/LV_Bridge_HLODLayer_Merged.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:4d8fb3fcc8a9f44d50d14d11ebde4a736c6d7228fbd07885b522d25fdcd038a5+size 3060diff --git a/unreal/Verse/Content/Verse/Decks/Engineering/DataLayers/DL_Engineering_Base.uasset b/unreal/Verse/Content/Verse/Decks/Engineering/DataLayers/DL_Engineering_Base.uassetnew file mode 100644index 0000000000..26905451d4--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Engineering/DataLayers/DL_Engineering_Base.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:eaded2bb7fc50b0c077082c437e9102822fd99df226d11c8f04f06b5a5d86ae7+size 1451diff --git a/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering.umap b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering.umapnew file mode 100644index 0000000000..9ad0eede71--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering.umap@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:a8816ed90b735054aef650eda16f6eb84f05ca462ab995249742305fd796038b+size 11112diff --git a/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Instanced.uasset b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Instanced.uassetnew file mode 100644index 0000000000..fb31e07e18--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Instanced.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:ff1b9f0b9cff5fcb88a6adef49fb341e05d22082c6d6648f2e5a483887a38394+size 1792diff --git a/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Merged.uasset b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Merged.uassetnew file mode 100644index 0000000000..4966f62f8a--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Engineering/LV_Engineering_HLODLayer_Merged.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:97a10ba324a8870b7f4b3cd5a3d691f7f77be3d33af812f7438889a4e9dd583a+size 3090diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Arena.uasset b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Arena.uassetnew file mode 100644index 0000000000..29cd73cc7c--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Arena.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:8750ffffcec38f4a05181798ff8d4ddde0f7109aeb911946bcdc33dbe5e03fee+size 1425diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Base.uasset b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Base.uassetnew file mode 100644index 0000000000..d8a69434c9--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Base.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:d81e2589f22d0ba680eb706f74126416356d82295643a44b386b830bd2bab434+size 1421diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Day.uasset b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Day.uassetnew file mode 100644index 0000000000..773bb26e68--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/DataLayers/DL_Hangar_Day.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:e0e67f3a563062dc27ab2865fdbc993e017d89b068486f78433c10f1f39fb713+size 1417diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar.umap b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar.umapnew file mode 100644index 0000000000..48bafecb91--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar.umap@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:81807a65a9b4b59ec08b3098765490a883225ab1ea630eace3efc664ccb6d619+size 11032diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Instanced.uasset b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Instanced.uassetnew file mode 100644index 0000000000..3346bc7e4d--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Instanced.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:bee5f4a11f79152a322304dc90070ffb01b6cb588a830f90aa8e738fe5637cec+size 1747diff --git a/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Merged.uasset b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Merged.uassetnew file mode 100644index 0000000000..d63465bda1--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Hangar/LV_Hangar_HLODLayer_Merged.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:8426fd9e1c1da02a3efcd8c40c1d8ba87d9cad33e9793fed526341f6a69188ab+size 3060diff --git a/unreal/Verse/Content/Verse/Decks/Ops/DataLayers/DL_Ops_Base.uasset b/unreal/Verse/Content/Verse/Decks/Ops/DataLayers/DL_Ops_Base.uassetnew file mode 100644index 0000000000..134682446d--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Ops/DataLayers/DL_Ops_Base.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:b31e378328d491086b79602004b9e52fd2fc8b21564913acf4de1694f2315b03+size 1403diff --git a/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops.umap b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops.umapnew file mode 100644index 0000000000..49a9924e64--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops.umap@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:0f7063d0d22f61a87257ee791bb096b6bf3fc116f1e5e61dbcdfc694d8c03011+size 10984diff --git a/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Instanced.uasset b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Instanced.uassetnew file mode 100644index 0000000000..4c1a5731ee--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Instanced.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:2e04fc90860886b00a2b69d8a48ceebf1dc06d70d3ff6905761878fd18d388e6+size 1720diff --git a/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Merged.uasset b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Merged.uassetnew file mode 100644index 0000000000..44e16b3499--- /dev/null+++ b/unreal/Verse/Content/Verse/Decks/Ops/LV_Ops_HLODLayer_Merged.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:1a1329393ecb88b5c760f3cb4ede2b2450acf21ad71c2fd2c3902ba33ea4755e+size 3042diff --git a/unreal/Verse/Content/Verse/Test/G0/PHYS_Test_Human.uasset b/unreal/Verse/Content/Verse/Test/G0/PHYS_Test_Human.uassetnew file mode 100644index 0000000000..9cb6c604fb--- /dev/null+++ b/unreal/Verse/Content/Verse/Test/G0/PHYS_Test_Human.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:e2b7078aa6c22501cb0668d8bf4d68b17e446c9069071c91c3f3f20ea16d3e3b+size 11404diff --git a/unreal/Verse/Content/Verse/Test/G0/SKEL_Test_Human.uasset b/unreal/Verse/Content/Verse/Test/G0/SKEL_Test_Human.uassetnew file mode 100644index 0000000000..9fc39ad9c8--- /dev/null+++ b/unreal/Verse/Content/Verse/Test/G0/SKEL_Test_Human.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:191e10928df7654aa7ab53183129eacdba7069a6ca74e776673b5fd6cdc1d8be+size 15874diff --git a/unreal/Verse/Content/Verse/Test/G0/SK_Test_Human.uasset b/unreal/Verse/Content/Verse/Test/G0/SK_Test_Human.uassetnew file mode 100644index 0000000000..ffc79f8a03--- /dev/null+++ b/unreal/Verse/Content/Verse/Test/G0/SK_Test_Human.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:a767871d5b4be0308253e65b8eecab0fb158afb75bf5d3e9b77a6f7f0e0babae+size 249121diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/1/W2/LDI49CSDZW3F12MWK05G4S.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/1/W2/LDI49CSDZW3F12MWK05G4S.uassetnew file mode 100644index 0000000000..df2bb5fa38--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/1/W2/LDI49CSDZW3F12MWK05G4S.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:e87f8a99da55b4e7b4004df6bd4c52f90ef4c3ccbf6efe7afe5203a9fe5bfc5b+size 3217diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/D/4P/T69ZCCFJHPUJMTM6O1W2UM.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/D/4P/T69ZCCFJHPUJMTM6O1W2UM.uassetnew file mode 100644index 0000000000..ee9b79892d--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Bridge/LV_Bridge/D/4P/T69ZCCFJHPUJMTM6O1W2UM.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:b8d4500a379ed003dd21907866565959a72721ee62fe1f4041f9dfd65ebad2e5+size 2342diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/7/SH/ZQ1IVCQQH00SSCFBI4XPRA.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/7/SH/ZQ1IVCQQH00SSCFBI4XPRA.uassetnew file mode 100644index 0000000000..73bbfed671--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/7/SH/ZQ1IVCQQH00SSCFBI4XPRA.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:d290e2656c71514b953714fd8d13a6dc90e54fdcce2ac57d24aa26fe66ceda2b+size 3292diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/C/K5/FC3RCUOGHNCHV9UMQOCUWG.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/C/K5/FC3RCUOGHNCHV9UMQOCUWG.uassetnew file mode 100644index 0000000000..07887d4e64--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Engineering/LV_Engineering/C/K5/FC3RCUOGHNCHV9UMQOCUWG.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:a35325242ed2e724065b3f6f9c10a95dc668a7e4bda1d0872c804530a210a261+size 2382diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/9/XB/3SXKPUPZCSRBKX9679BZPE.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/9/XB/3SXKPUPZCSRBKX9679BZPE.uassetnew file mode 100644index 0000000000..a178889ae6--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/9/XB/3SXKPUPZCSRBKX9679BZPE.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:a88f72a49072f03de1f065a08f2ac01a3b87e637c83b954c8d16519a25a104b0+size 2342diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/A/0Q/18TUI2WK5IF7KDDMAYPVB9.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/A/0Q/18TUI2WK5IF7KDDMAYPVB9.uassetnew file mode 100644index 0000000000..50b9021d4d--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Hangar/LV_Hangar/A/0Q/18TUI2WK5IF7KDDMAYPVB9.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:8290847e388268f90b619e614b5c2f2dea10310f09e813192d002d53fa2f0dfe+size 4404diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/8/0R/2G6UKH4K5TZON5L3R1J0EO.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/8/0R/2G6UKH4K5TZON5L3R1J0EO.uassetnew file mode 100644index 0000000000..f3f4e8bdf4--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/8/0R/2G6UKH4K5TZON5L3R1J0EO.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:88bd61262749d2fac9cc2cf42099e5065db1851963efae697cfda04b99fe13ab+size 2318diff --git a/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/A/YP/8PKZMBQDA43RU9S6MS9HUR.uasset b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/A/YP/8PKZMBQDA43RU9S6MS9HUR.uassetnew file mode 100644index 0000000000..29ed2f95e6--- /dev/null+++ b/unreal/Verse/Content/__ExternalActors__/Verse/Decks/Ops/LV_Ops/A/YP/8PKZMBQDA43RU9S6MS9HUR.uasset@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:ff860c483c3c6fff9bdf63cc590e6b10601d8d9d0a9f858cd712f86b649ffdca+size 3172diff --git a/unreal/Verse/Source/Verse/Private/Tests/VerseG0ContentTest.cpp b/unreal/Verse/Source/Verse/Private/Tests/VerseG0ContentTest.cppnew file mode 100644index 0000000000..8eea17f762--- /dev/null+++ b/unreal/Verse/Source/Verse/Private/Tests/VerseG0ContentTest.cpp@@ -0,0 +1,183 @@+#include "Misc/AutomationTest.h"+#include "Misc/PackageName.h"+#include "Engine/World.h"+#include "Engine/Level.h"+#include "Engine/SkeletalMesh.h"+#include "GameFramework/WorldSettings.h"+#include "PhysicsEngine/PhysicsAsset.h"+#include "PhysicsEngine/SkeletalBodySetup.h"+#include "ReferenceSkeleton.h"+#include "WorldPartition/WorldPartition.h"+#include "WorldPartition/DataLayer/DataLayerAsset.h"++#if WITH_DEV_AUTOMATION_TESTS && WITH_EDITOR++// Verse.Content.Levels: the G0.8 deck maps exist as World Partition maps with One+// File Per Actor on, and every data layer asset of art-pipeline 3 is in place.+// scripts/unreal/g0_content.py regenerates them; its verify step also checks the+// data layer instances inside each world.+IMPLEMENT_SIMPLE_AUTOMATION_TEST(FVerseContentLevelsTest, "Verse.Content.Levels",+ EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::EngineFilter)++bool FVerseContentLevelsTest::RunTest(const FString& Parameters)+{+ struct FDeck { const TCHAR* Name; TArray<const TCHAR*> Layers; };+ const FDeck Decks[] = {+ { TEXT("Bridge"), { TEXT("DL_Bridge_Base") } },+ { TEXT("Ops"), { TEXT("DL_Ops_Base") } },+ { TEXT("Engineering"), { TEXT("DL_Engineering_Base") } },+ { TEXT("Hangar"), { TEXT("DL_Hangar_Base"), TEXT("DL_Hangar_Day"), TEXT("DL_Hangar_Arena") } },+ };+ for (const FDeck& Deck : Decks)+ {+ const FString MapPath = FString::Printf(TEXT("/Game/Verse/Decks/%s/LV_%s"), Deck.Name, Deck.Name);+ if (!TestTrue(FString::Printf(TEXT("%s exists"), *MapPath), FPackageName::DoesPackageExist(MapPath)))+ {+ continue;+ }+ const UWorld* World = LoadObject<UWorld>(nullptr, *(MapPath + TEXT(".LV_") + Deck.Name));+ if (TestNotNull(FString::Printf(TEXT("%s loads"), *MapPath), World))+ {+ TestNotNull(FString::Printf(TEXT("%s is World Partition"), *MapPath),+ World->GetWorldSettings() ? World->GetWorldSettings()->GetWorldPartition() : nullptr);+ TestTrue(FString::Printf(TEXT("%s uses One File Per Actor"), *MapPath),+ World->PersistentLevel && World->PersistentLevel->IsUsingExternalActors());+ }+ for (const TCHAR* Layer : Deck.Layers)+ {+ const FString LayerPath = FString::Printf(TEXT("/Game/Verse/Decks/%s/DataLayers/%s.%s"), Deck.Name, Layer, Layer);+ const UDataLayerAsset* Asset = LoadObject<UDataLayerAsset>(nullptr, *LayerPath);+ if (TestNotNull(FString::Printf(TEXT("%s exists"), *LayerPath), Asset))+ {+ TestTrue(FString::Printf(TEXT("%s is a runtime layer"), Layer), Asset->IsRuntime());+ }+ }+ }+ return true;+}++// Verse.Content.TestHuman: SK_Test_Human carries every frozen bone of+// art-pipeline 12.1 with the frozen parent, plus hit bodies in its physics asset.+IMPLEMENT_SIMPLE_AUTOMATION_TEST(FVerseContentTestHumanTest, "Verse.Content.TestHuman",+ EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::EngineFilter)++bool FVerseContentTestHumanTest::RunTest(const FString& Parameters)+{+ const USkeletalMesh* Mesh = LoadObject<USkeletalMesh>(nullptr, TEXT("/Game/Verse/Test/G0/SK_Test_Human.SK_Test_Human"));+ if (!TestNotNull(TEXT("SK_Test_Human loads"), Mesh))+ {+ return false;+ }+ const FReferenceSkeleton& Ref = Mesh->GetRefSkeleton();+ const TPair<const TCHAR*, const TCHAR*> Bones[] = {+ { TEXT("Root"), TEXT("") },+ { TEXT("Hips"), TEXT("Root") },+ { TEXT("Spine_01"), TEXT("Hips") },+ { TEXT("Spine_02"), TEXT("Spine_01") },+ { TEXT("Spine_03"), TEXT("Spine_02") },+ { TEXT("Neck"), TEXT("Spine_03") },+ { TEXT("Head"), TEXT("Neck") },+ { TEXT("Camera"), TEXT("Head") },+ { TEXT("Clavicle_L"), TEXT("Spine_03") },+ { TEXT("UpperArm_L"), TEXT("Clavicle_L") },+ { TEXT("UpperArm_Twist_L"), TEXT("UpperArm_L") },+ { TEXT("LowerArm_L"), TEXT("UpperArm_L") },+ { TEXT("LowerArm_Twist_L"), TEXT("LowerArm_L") },+ { TEXT("Hand_L"), TEXT("LowerArm_L") },+ { TEXT("Index_01_L"), TEXT("Hand_L") },+ { TEXT("Index_02_L"), TEXT("Index_01_L") },+ { TEXT("Index_03_L"), TEXT("Index_02_L") },+ { TEXT("Middle_01_L"), TEXT("Hand_L") },+ { TEXT("Middle_02_L"), TEXT("Middle_01_L") },+ { TEXT("Middle_03_L"), TEXT("Middle_02_L") },+ { TEXT("Ring_01_L"), TEXT("Hand_L") },+ { TEXT("Ring_02_L"), TEXT("Ring_01_L") },+ { TEXT("Ring_03_L"), TEXT("Ring_02_L") },+ { TEXT("Pinky_01_L"), TEXT("Hand_L") },+ { TEXT("Pinky_02_L"), TEXT("Pinky_01_L") },+ { TEXT("Pinky_03_L"), TEXT("Pinky_02_L") },+ { TEXT("Thumb_01_L"), TEXT("Hand_L") },+ { TEXT("Thumb_02_L"), TEXT("Thumb_01_L") },+ { TEXT("Thumb_03_L"), TEXT("Thumb_02_L") },+ { TEXT("Weapon_L"), TEXT("Hand_L") },+ { TEXT("Thigh_L"), TEXT("Hips") },+ { TEXT("Thigh_Twist_L"), TEXT("Thigh_L") },+ { TEXT("Calf_L"), TEXT("Thigh_L") },+ { TEXT("Calf_Twist_L"), TEXT("Calf_L") },+ { TEXT("Foot_L"), TEXT("Calf_L") },+ { TEXT("Ball_L"), TEXT("Foot_L") },+ { TEXT("Clavicle_R"), TEXT("Spine_03") },+ { TEXT("UpperArm_R"), TEXT("Clavicle_R") },+ { TEXT("UpperArm_Twist_R"), TEXT("UpperArm_R") },+ { TEXT("LowerArm_R"), TEXT("UpperArm_R") },+ { TEXT("LowerArm_Twist_R"), TEXT("LowerArm_R") },+ { TEXT("Hand_R"), TEXT("LowerArm_R") },+ { TEXT("Index_01_R"), TEXT("Hand_R") },+ { TEXT("Index_02_R"), TEXT("Index_01_R") },+ { TEXT("Index_03_R"), TEXT("Index_02_R") },+ { TEXT("Middle_01_R"), TEXT("Hand_R") },+ { TEXT("Middle_02_R"), TEXT("Middle_01_R") },+ { TEXT("Middle_03_R"), TEXT("Middle_02_R") },+ { TEXT("Ring_01_R"), TEXT("Hand_R") },+ { TEXT("Ring_02_R"), TEXT("Ring_01_R") },+ { TEXT("Ring_03_R"), TEXT("Ring_02_R") },+ { TEXT("Pinky_01_R"), TEXT("Hand_R") },+ { TEXT("Pinky_02_R"), TEXT("Pinky_01_R") },+ { TEXT("Pinky_03_R"), TEXT("Pinky_02_R") },+ { TEXT("Thumb_01_R"), TEXT("Hand_R") },+ { TEXT("Thumb_02_R"), TEXT("Thumb_01_R") },+ { TEXT("Thumb_03_R"), TEXT("Thumb_02_R") },+ { TEXT("Weapon_R"), TEXT("Hand_R") },+ { TEXT("Thigh_R"), TEXT("Hips") },+ { TEXT("Thigh_Twist_R"), TEXT("Thigh_R") },+ { TEXT("Calf_R"), TEXT("Thigh_R") },+ { TEXT("Calf_Twist_R"), TEXT("Calf_R") },+ { TEXT("Foot_R"), TEXT("Calf_R") },+ { TEXT("Ball_R"), TEXT("Foot_R") },+ { TEXT("IK_Foot_Root"), TEXT("Root") },+ { TEXT("IK_Hand_Root"), TEXT("Root") },+ { TEXT("IK_Foot_L"), TEXT("IK_Foot_Root") },+ { TEXT("IK_Foot_R"), TEXT("IK_Foot_Root") },+ { TEXT("IK_Hand_Gun"), TEXT("IK_Hand_Root") },+ { TEXT("IK_Hand_L"), TEXT("IK_Hand_Gun") },+ { TEXT("IK_Hand_R"), TEXT("IK_Hand_Gun") },+ };+ TestEqual(TEXT("bone count"), Ref.GetRawBoneNum(), int32(UE_ARRAY_COUNT(Bones)));+ TestEqual(TEXT("first bone is Root"), Ref.GetBoneName(0), FName(TEXT("Root")));+ for (const TPair<const TCHAR*, const TCHAR*>& Bone : Bones)+ {+ const int32 Index = Ref.FindRawBoneIndex(FName(Bone.Key));+ if (!TestTrue(FString::Printf(TEXT("bone %s exists"), Bone.Key), Index != INDEX_NONE))+ {+ continue;+ }+ const int32 Parent = Ref.GetRawParentIndex(Index);+ const FName ParentName = Parent == INDEX_NONE ? NAME_None : Ref.GetBoneName(Parent);+ const FName Expected = *Bone.Value ? FName(Bone.Value) : NAME_None;+ TestEqual(FString::Printf(TEXT("parent of %s"), Bone.Key), ParentName, Expected);+ }++ const UPhysicsAsset* Physics = Mesh->GetPhysicsAsset();+ if (TestNotNull(TEXT("SK_Test_Human has a physics asset"), Physics))+ {+ const TCHAR* HitBones[] = {+ TEXT("Hips"), TEXT("Spine_01"), TEXT("Spine_03"), TEXT("Neck"), TEXT("Head"),+ TEXT("UpperArm_L"), TEXT("UpperArm_R"), TEXT("LowerArm_L"), TEXT("LowerArm_R"),+ TEXT("Thigh_L"), TEXT("Thigh_R"), TEXT("Calf_L"), TEXT("Calf_R"),+ };+ TArray<FString> Bodies;+ for (const USkeletalBodySetup* Body : Physics->SkeletalBodySetups)+ {+ Bodies.Add(Body ? Body->BoneName.ToString() : TEXT("<null>"));+ }+ AddInfo(FString::Printf(TEXT("PHYS_Test_Human bodies: %s"), *FString::Join(Bodies, TEXT(", "))));+ TestEqual(TEXT("hit body count"), Physics->SkeletalBodySetups.Num(), int32(UE_ARRAY_COUNT(HitBones)));+ for (const TCHAR* Bone : HitBones)+ {+ TestTrue(FString::Printf(TEXT("hit body on %s"), Bone), Physics->FindBodyIndex(FName(Bone)) != INDEX_NONE);+ }+ }+ return true;+}++#endif // WITH_DEV_AUTOMATION_TESTS && WITH_EDITORdiff --git a/unreal/Verse/Source/Verse/Private/VerseContentTools.cpp b/unreal/Verse/Source/Verse/Private/VerseContentTools.cppnew file mode 100644index 0000000000..653e144dfb--- /dev/null+++ b/unreal/Verse/Source/Verse/Private/VerseContentTools.cpp@@ -0,0 +1,71 @@+#include "VerseContentTools.h"++#if WITH_EDITOR+#include "Engine/SkeletalMesh.h"+#include "PhysicsEngine/PhysicsAsset.h"+#include "PhysicsEngine/SkeletalBodySetup.h"+#include "ReferenceSkeleton.h"++bool UVerseContentTools::RebuildHitBodies(UPhysicsAsset* PhysicsAsset, USkeletalMesh* Mesh,+ const TArray<FName>& Bones, const TArray<FName>& EndBones, const TArray<float>& Radii)+{+ if (!PhysicsAsset || !Mesh || Bones.Num() != EndBones.Num() || Bones.Num() != Radii.Num())+ {+ return false;+ }+ const FReferenceSkeleton& Ref = Mesh->GetRefSkeleton();+ const TArray<FTransform>& Local = Ref.GetRefBonePose();+ TArray<FTransform> Component;+ Component.SetNum(Local.Num());+ for (int32 Index = 0; Index < Local.Num(); ++Index)+ {+ const int32 Parent = Ref.GetParentIndex(Index);+ Component[Index] = Parent == INDEX_NONE ? Local[Index] : Local[Index] * Component[Parent];+ }++ PhysicsAsset->Modify();+ PhysicsAsset->SkeletalBodySetups.Empty();+ PhysicsAsset->ConstraintSetup.Empty();+ PhysicsAsset->CollisionDisableTable.Empty();++ for (int32 Entry = 0; Entry < Bones.Num(); ++Entry)+ {+ const int32 Bone = Ref.FindBoneIndex(Bones[Entry]);+ if (Bone == INDEX_NONE)+ {+ return false;+ }+ const float Radius = Radii[Entry];+ const FVector Start = Component[Bone].GetLocation();+ FVector End;+ const int32 EndBone = EndBones[Entry].IsNone() ? INDEX_NONE : Ref.FindBoneIndex(EndBones[Entry]);+ if (EndBone != INDEX_NONE)+ {+ End = Component[EndBone].GetLocation();+ }+ else+ {+ const int32 Parent = Ref.GetParentIndex(Bone);+ const FVector Dir = Parent == INDEX_NONE ? FVector::UpVector : (Start - Component[Parent].GetLocation()).GetSafeNormal();+ End = Start + Dir * (2.0f * Radius);+ }+ const FVector LocalDir = Component[Bone].InverseTransformVector(End - Start);++ FKSphylElem Capsule;+ Capsule.Radius = Radius;+ Capsule.Length = FMath::Max(1.0f, float(LocalDir.Size()) - Radius);+ Capsule.Center = Component[Bone].InverseTransformPosition((Start + End) * 0.5f);+ Capsule.Rotation = FRotationMatrix::MakeFromZ(LocalDir.GetSafeNormal()).Rotator();++ USkeletalBodySetup* Body = NewObject<USkeletalBodySetup>(PhysicsAsset, NAME_None, RF_Transactional);+ Body->BoneName = Bones[Entry];+ Body->PhysicsType = PhysType_Default;+ Body->AggGeom.SphylElems.Add(Capsule);+ PhysicsAsset->SkeletalBodySetups.Add(Body);+ }+ PhysicsAsset->UpdateBodySetupIndexMap();+ PhysicsAsset->UpdateBoundsBodiesArray();+ PhysicsAsset->MarkPackageDirty();+ return true;+}+#endif // WITH_EDITORdiff --git a/unreal/Verse/Source/Verse/Public/VerseContentTools.h b/unreal/Verse/Source/Verse/Public/VerseContentTools.hnew file mode 100644index 0000000000..4fc0221213--- /dev/null+++ b/unreal/Verse/Source/Verse/Public/VerseContentTools.h@@ -0,0 +1,27 @@+#pragma once++#include "CoreMinimal.h"+#include "Kismet/BlueprintFunctionLibrary.h"+#include "VerseContentTools.generated.h"++class UPhysicsAsset;+class USkeletalMesh;++// Editor helpers for the content generators in scripts/unreal/ (G0.8, G0.9).+// Called from editor Python; nothing here runs in a packaged game.+UCLASS()+class VERSE_API UVerseContentTools : public UBlueprintFunctionLibrary+{+ GENERATED_BODY()++public:+#if WITH_EDITOR+ // Replaces every body and constraint of PhysicsAsset with one capsule per+ // entry of Bones, running from that bone to EndBones[i] (or, when the end is+ // None, onward along the parent-to-bone direction) with radius Radii[i] in cm.+ // Hit bodies only (art-pipeline 12.1, architecture 3.3); ragdoll tuning is WP13's.+ UFUNCTION(BlueprintCallable, Category = "Verse|Content")+ static bool RebuildHitBodies(UPhysicsAsset* PhysicsAsset, USkeletalMesh* Mesh,+ const TArray<FName>& Bones, const TArray<FName>& EndBones, const TArray<float>& Radii);+#endif+};diff --git a/unreal/Verse/Source/VerseCore/Private/Tests/VerseCollisionConfigTest.cpp b/unreal/Verse/Source/VerseCore/Private/Tests/VerseCollisionConfigTest.cppnew file mode 100644index 0000000000..4d3ca9a5fe--- /dev/null+++ b/unreal/Verse/Source/VerseCore/Private/Tests/VerseCollisionConfigTest.cpp@@ -0,0 +1,103 @@+#include "Misc/AutomationTest.h"+#include "Engine/CollisionProfile.h"+#include "VerseCollision.h"++#if WITH_DEV_AUTOMATION_TESTS++// Verse.Core.Collision: the project collision config matches VerseCollision.h and+// the response tables of contracts/art-pipeline.md 5 and contracts/destruction.md.+IMPLEMENT_SIMPLE_AUTOMATION_TEST(FVerseCollisionConfigTest, "Verse.Core.Collision",+ EAutomationTestFlags_ApplicationContextMask | EAutomationTestFlags::EngineFilter)++namespace+{+ ECollisionResponse ResponseOf(const FCollisionResponseTemplate& Template, ECollisionChannel Channel)+ {+ return Template.ResponseToChannels.GetResponse(Channel);+ }+}++bool FVerseCollisionConfigTest::RunTest(const FString& Parameters)+{+ UCollisionProfile* Profiles = UCollisionProfile::Get();+ if (!TestNotNull(TEXT("collision profile settings"), Profiles))+ {+ return false;+ }++ const TPair<ECollisionChannel, FName> Channels[] = {+ { VerseCollision::Bolt, VerseCollision::BoltName },+ { VerseCollision::Sight, VerseCollision::SightName },+ { VerseCollision::HitBody, VerseCollision::HitBodyName },+ { VerseCollision::Debris, VerseCollision::DebrisName },+ };+ for (const TPair<ECollisionChannel, FName>& Channel : Channels)+ {+ TestEqual(FString::Printf(TEXT("channel slot of %s"), *Channel.Value.ToString()),+ Profiles->ReturnChannelNameFromContainerIndex(Channel.Key), Channel.Value);+ }++ const FName ProfileNames[] = {+ VerseCollision::Profile::Architecture, VerseCollision::Profile::Destructible,+ VerseCollision::Profile::Glass, VerseCollision::Profile::Prop,+ VerseCollision::Profile::PropSmall, VerseCollision::Profile::Debris,+ VerseCollision::Profile::ProxyOnly, VerseCollision::Profile::NoCollision,+ };+ for (const FName& Name : ProfileNames)+ {+ FCollisionResponseTemplate Template;+ TestTrue(FString::Printf(TEXT("profile %s exists"), *Name.ToString()), Profiles->GetProfileTemplate(Name, Template));+ }++ // Rows of the contract tables (Pawn and weapon trace columns, the debris and hit body rules).+ struct FExpect { FName Profile; ECollisionChannel Channel; ECollisionResponse Response; };+ const FExpect Expectations[] = {+ { VerseCollision::Profile::Architecture, ECC_Pawn, ECR_Block },+ { VerseCollision::Profile::Architecture, VerseCollision::Bolt, ECR_Block },+ { VerseCollision::Profile::Architecture, VerseCollision::Sight, ECR_Block },+ { VerseCollision::Profile::Architecture, VerseCollision::HitBody, ECR_Ignore },+ { VerseCollision::Profile::Destructible, VerseCollision::Bolt, ECR_Block },+ { VerseCollision::Profile::Destructible, VerseCollision::HitBody, ECR_Ignore },+ { VerseCollision::Profile::Glass, ECC_Pawn, ECR_Block },+ { VerseCollision::Profile::Glass, VerseCollision::Bolt, ECR_Block },+ { VerseCollision::Profile::Glass, VerseCollision::Sight, ECR_Overlap },+ { VerseCollision::Profile::Prop, ECC_Pawn, ECR_Block },+ { VerseCollision::Profile::PropSmall, ECC_Pawn, ECR_Ignore },+ { VerseCollision::Profile::PropSmall, VerseCollision::Bolt, ECR_Block },+ { VerseCollision::Profile::Debris, ECC_Pawn, ECR_Ignore },+ { VerseCollision::Profile::Debris, VerseCollision::Bolt, ECR_Ignore },+ { VerseCollision::Profile::Debris, VerseCollision::Sight, ECR_Ignore },+ { VerseCollision::Profile::Debris, VerseCollision::HitBody, ECR_Ignore },+ { VerseCollision::Profile::Debris, ECC_WorldStatic, ECR_Block },+ { VerseCollision::Profile::NoCollision, VerseCollision::Bolt, ECR_Ignore },+ { FName(TEXT("Pawn")), VerseCollision::Bolt, ECR_Ignore },+ { FName(TEXT("Pawn")), VerseCollision::HitBody, ECR_Ignore },+ { FName(TEXT("Pawn")), VerseCollision::Debris, ECR_Ignore },+ { FName(TEXT("CharacterMesh")), VerseCollision::HitBody, ECR_Block },+ { FName(TEXT("CharacterMesh")), VerseCollision::Bolt, ECR_Ignore },+ };+ for (const FExpect& Expect : Expectations)+ {+ FCollisionResponseTemplate Template;+ if (Profiles->GetProfileTemplate(Expect.Profile, Template))+ {+ TestEqual(FString::Printf(TEXT("%s response to %s"), *Expect.Profile.ToString(),+ *Profiles->ReturnChannelNameFromContainerIndex(Expect.Channel).ToString()),+ int32(ResponseOf(Template, Expect.Channel)), int32(Expect.Response));+ }+ }++ FCollisionResponseTemplate DebrisTemplate;+ if (Profiles->GetProfileTemplate(VerseCollision::Profile::Debris, DebrisTemplate))+ {+ TestEqual(TEXT("Verse_Debris object type"), int32(DebrisTemplate.ObjectType), int32(VerseCollision::Debris));+ }+ FCollisionResponseTemplate NoneTemplate;+ if (Profiles->GetProfileTemplate(VerseCollision::Profile::NoCollision, NoneTemplate))+ {+ TestEqual(TEXT("Verse_NoCollision is off"), int32(NoneTemplate.CollisionEnabled.GetValue()), int32(ECollisionEnabled::NoCollision));+ }+ return true;+}++#endif // WITH_DEV_AUTOMATION_TESTSdiff --git a/unreal/Verse/Source/VerseCore/Public/VerseCollision.h b/unreal/Verse/Source/VerseCore/Public/VerseCollision.hnew file mode 100644index 0000000000..0333417004--- /dev/null+++ b/unreal/Verse/Source/VerseCore/Public/VerseCollision.h@@ -0,0 +1,38 @@+#pragma once++#include "CoreMinimal.h"+#include "Engine/EngineTypes.h"++// Verse collision channels and profiles (G0.8).+// Channel names are frozen in docs/verse/unreal/contracts/destruction.md, profile+// names in contracts/art-pipeline.md section 5. The channel slots match+// Config/DefaultEngine.ini [/Script/Engine.CollisionProfile]; Verse.Core.Collision+// fails when the two drift apart. Code never spells ECC_GameTraceChannelN itself.+namespace VerseCollision+{+ // Trace: bolts against piece proxies, world, Bulwark and drones.+ inline constexpr ECollisionChannel Bolt = ECC_GameTraceChannel1;+ // Trace: sight lines (TestSight applies the glass, grating and hole rules).+ inline constexpr ECollisionChannel Sight = ECC_GameTraceChannel2;+ // Trace: per-bone hit bodies only; pieces, world and debris ignore it.+ inline constexpr ECollisionChannel HitBody = ECC_GameTraceChannel3;+ // Object: debris chunks; ignores pawns, bolts, sight and hit bodies.+ inline constexpr ECollisionChannel Debris = ECC_GameTraceChannel4;++ inline const FName BoltName(TEXT("VerseBolt"));+ inline const FName SightName(TEXT("VerseSight"));+ inline const FName HitBodyName(TEXT("VerseHitBody"));+ inline const FName DebrisName(TEXT("VerseDebris"));++ namespace Profile+ {+ inline const FName Architecture(TEXT("Verse_Architecture"));+ inline const FName Destructible(TEXT("Verse_Destructible"));+ inline const FName Glass(TEXT("Verse_Glass"));+ inline const FName Prop(TEXT("Verse_Prop"));+ inline const FName PropSmall(TEXT("Verse_PropSmall"));+ inline const FName Debris(TEXT("Verse_Debris"));+ inline const FName ProxyOnly(TEXT("Verse_ProxyOnly"));+ inline const FName NoCollision(TEXT("Verse_NoCollision"));+ }+}