From 20b26377dc72160b47bcd4def932e08b826dbe7e Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 8 Jul 2025 23:38:03 -0400 Subject: [PATCH] Begin logging collision asset paths in naivmesh gen --- src/bin/kawari-navimesh.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/bin/kawari-navimesh.rs b/src/bin/kawari-navimesh.rs index 5f5226f..f5e1945 100644 --- a/src/bin/kawari-navimesh.rs +++ b/src/bin/kawari-navimesh.rs @@ -2,6 +2,7 @@ use icarus::TerritoryType::TerritoryTypeSheet; use kawari::config::get_config; use physis::{ common::{Language, Platform}, + layer::{LayerEntryData, LayerGroup}, lvb::Lvb, resource::{Resource, SqPackResource}, }; @@ -34,6 +35,30 @@ fn main() { for path in &lvb.scns[0].header.path_layer_group_resources { if path.contains("bg.lgb") { tracing::info!("Processing {path}"); + + let lgb_file = sqpack_resource.read(path).unwrap(); + let lgb = LayerGroup::from_existing(&lgb_file); + let Some(lgb) = lgb else { + tracing::error!( + "Failed to parse {path}, this is most likely a bug in Physis and should be reported somewhere!" + ); + return; + }; + + // TODO: i think we know which layer is specifically used for navmesh gen, better check that LVB + for chunk in &lgb.chunks { + for layer in &chunk.layers { + for object in &layer.objects { + if let LayerEntryData::BG(bg) = &object.data { + if !bg.collision_asset_path.value.is_empty() { + tracing::info!("Considering {} for navimesh", object.instance_id); + + tracing::info!("- Loading {}", bg.collision_asset_path.value); + } + } + } + } + } } } }