Clean actor runtime baseline after motion fix
This commit is contained in:
@@ -15,6 +15,7 @@ BASE_MODEL_RE = re.compile(r'^BaseModelFileName\s+"([^"]+)"', re.IGNORECASE)
|
||||
EFFECT_SCRIPT_RE = re.compile(r'^EffectScriptName\s+"([^"]+)"', re.IGNORECASE)
|
||||
DEFAULT_HIT_EFFECT_RE = re.compile(r'^DefaultHitEffectFileName\s+"([^"]*)"', re.IGNORECASE)
|
||||
DEFAULT_HIT_SOUND_RE = re.compile(r'^DefaultHitSoundFileName\s+"([^"]*)"', re.IGNORECASE)
|
||||
MOTION_FILE_RE = re.compile(r'^MotionFileName\s+"([^"]+)"', re.IGNORECASE)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -110,6 +111,15 @@ def parse_motlist(path: Path) -> list[str]:
|
||||
return motions
|
||||
|
||||
|
||||
def parse_msa_motion_file(path: Path) -> str | None:
|
||||
for raw_line in path.read_text(encoding="utf-8", errors="ignore").splitlines():
|
||||
line = raw_line.strip()
|
||||
match = MOTION_FILE_RE.match(line)
|
||||
if match:
|
||||
return match.group(1)
|
||||
return None
|
||||
|
||||
|
||||
def parse_msm_references(path: Path) -> tuple[str | None, list[str], list[str], list[str]]:
|
||||
base_model: str | None = None
|
||||
effect_scripts: list[str] = []
|
||||
@@ -146,6 +156,13 @@ def validate_actor_dir(pack: str, pack_dir: Path, actor_dir: Path, asset_index:
|
||||
if not msa_path.is_file():
|
||||
missing_msa.append(motion)
|
||||
continue
|
||||
motion_file = parse_msa_motion_file(msa_path)
|
||||
if motion_file:
|
||||
resolved_motion = normalize_virtual_path(motion_file)
|
||||
if resolved_motion not in asset_index:
|
||||
missing_gr2_for_motions.append(resolved_motion)
|
||||
continue
|
||||
|
||||
gr2_name = Path(motion).with_suffix(".gr2").name
|
||||
if not (actor_dir / gr2_name).is_file():
|
||||
missing_gr2_for_motions.append(gr2_name)
|
||||
@@ -234,7 +251,8 @@ def main() -> int:
|
||||
failures.append(message)
|
||||
issue_map[issue_id] = message
|
||||
for gr2_name in check.missing_gr2_for_motions:
|
||||
issue_id = f"actor:paired_model:{check.actor_dir}:{gr2_name.lower()}"
|
||||
normalized_gr2 = normalize_virtual_path(gr2_name)
|
||||
issue_id = f"actor:paired_model:{check.actor_dir}:{normalized_gr2}"
|
||||
message = f"{check.actor_dir}: missing paired model {gr2_name}"
|
||||
failures.append(message)
|
||||
issue_map[issue_id] = message
|
||||
|
||||
Reference in New Issue
Block a user