From f55c17dc4b83641a5d5961561648d044026496cc Mon Sep 17 00:00:00 2001 From: chazmm Date: Wed, 9 Sep 2026 04:25:35 +0100 Subject: [PATCH] Remove checkout dependency from packaged gesture menu preparation --- tools/asset_pipeline/customisation_profiles.py | 6 ++---- tools/asset_pipeline/test_customiser_setup.py | 9 +++++++++ tools/mixamo_to_skate/check_package.py | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/asset_pipeline/customisation_profiles.py b/tools/asset_pipeline/customisation_profiles.py index 907fc00e..5f11eafa 100644 --- a/tools/asset_pipeline/customisation_profiles.py +++ b/tools/asset_pipeline/customisation_profiles.py @@ -2,7 +2,6 @@ import json,struct,re from pathlib import Path from tools.asset_pipeline.customisation_native import key_hash -from tools.asset_pipeline.customisation_worker import ROOT def generate(native): def page(name,children):return dict(label=name,children=children) @@ -25,9 +24,8 @@ def generate(native): if len(values)!=19:raise ValueError('Incomplete native face preset') gender,number=row['key'].split('_') presets.append(choice('Face '+str(int(number)),{'morphs':values},gender=gender)) - source=(ROOT/'crates/skate-game/src/graph_host/motion_character_gesture.rs').read_text() - names=re.findall(r'"B_GSTR_([A-Z_]+)"',source) - if len(names)!=37:raise ValueError('Native gesture table changed') + # These indices match the runtime gesture table. Source-tree consistency + # belongs in tests; a player's setup has no Rust checkout. labels=['Air guitar','Airplane','Boxing','Bruce Lee','Check the time','Devil horns','Finger guns','Dunno', 'Finger wag','Fists','Flex','Flip the table','The Fonz','Freedom','Raised fist','Get away','Get outta here', 'Handcuffs','High fist pump','Low fist pump','Wind up','Peace','Point','Raise the roof','Shaka','Shrug', diff --git a/tools/asset_pipeline/test_customiser_setup.py b/tools/asset_pipeline/test_customiser_setup.py index fe771f98..b7a8c57d 100644 --- a/tools/asset_pipeline/test_customiser_setup.py +++ b/tools/asset_pipeline/test_customiser_setup.py @@ -8,6 +8,15 @@ from tools.asset_pipeline import customiser_setup as s class CharacterSetup(unittest.TestCase): + def test_gesture_menu_matches_runtime_table_without_reading_source(self): + import re + from tools.asset_pipeline.customisation_profiles import generate + source = Path(__file__).resolve().parents[2]/'crates/skate-game/src/graph_host/motion_character_gesture.rs' + count = len(re.findall(r'"B_GSTR_([A-Z_]+)"', source.read_text())) + with patch.object(Path, 'read_text', side_effect=AssertionError('setup must not read Rust source')): + menu = generate({'morphs': [], 'collections': []}) + self.assertEqual(len(menu[-1]['children'][0]['children'][0]['children']), count) + def setUp(self): source = patch.object(s, 'source_fingerprint', return_value='owned-disc') source.start() diff --git a/tools/mixamo_to_skate/check_package.py b/tools/mixamo_to_skate/check_package.py index 4d4fc7f9..8f513c05 100644 --- a/tools/mixamo_to_skate/check_package.py +++ b/tools/mixamo_to_skate/check_package.py @@ -31,6 +31,8 @@ def main(): assert result.returncode == 0, result.stderr assert b'0.9.7' in result.stdout + result.stderr assert len(customiser_setup.fingerprint()) == 64 + menu = customisation_profiles.generate({'morphs': [], 'collections': []}) + assert len(menu[-1]['children'][0]['children'][0]['children']) == 37 return from test_converter import fixture from converter import validate_output