diff --git a/LightlessSync/Services/ModelDecimation/MdlDecimator.cs b/LightlessSync/Services/ModelDecimation/MdlDecimator.cs index cbecf68..55b511c 100644 --- a/LightlessSync/Services/ModelDecimation/MdlDecimator.cs +++ b/LightlessSync/Services/ModelDecimation/MdlDecimator.cs @@ -59,25 +59,25 @@ internal static class MdlDecimator var tuning = settings.Advanced; if (!TryReadModelBytes(sourcePath, logger, out var data)) { - logger.LogInformation("Skipping model decimation; source file locked or unreadable: {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; source file locked or unreadable: {Path}", sourcePath); return false; } var mdl = new MdlFile(data); if (!mdl.Valid) { - logger.LogInformation("Skipping model decimation; invalid mdl: {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; invalid mdl: {Path}", sourcePath); return false; } if (mdl.LodCount != 1) { - logger.LogInformation("Skipping model decimation; unsupported LOD count for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; unsupported LOD count for {Path}", sourcePath); return false; } if (HasShapeData(mdl)) { - logger.LogInformation("Skipping model decimation; shape/morph data present for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; shape/morph data present for {Path}", sourcePath); return false; } @@ -86,13 +86,13 @@ internal static class MdlDecimator var meshes = mdl.Meshes.ToArray(); if (meshes.Length == 0) { - logger.LogInformation("Skipping model decimation; no meshes for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; no meshes for {Path}", sourcePath); return false; } if (lod.MeshCount == 0) { - logger.LogInformation("Skipping model decimation; no meshes for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; no meshes for {Path}", sourcePath); return false; } @@ -100,7 +100,7 @@ internal static class MdlDecimator var lodMeshEnd = lodMeshStart + lod.MeshCount; if (lodMeshStart < 0 || lodMeshEnd > meshes.Length) { - logger.LogInformation("Skipping model decimation; invalid LOD mesh range for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; invalid LOD mesh range for {Path}", sourcePath); return false; } @@ -214,7 +214,7 @@ internal static class MdlDecimator if (!anyDecimated) { - logger.LogInformation("Skipping model decimation; no eligible meshes for {Path}", sourcePath); + logger.LogDebug("Skipping model decimation; no eligible meshes for {Path}", sourcePath); return false; } @@ -426,7 +426,7 @@ internal static class MdlDecimator if (decimatedTriangles <= 0 || decimatedTriangles >= triangleCount) { - logger.LogInformation( + logger.LogDebug( "Mesh {MeshIndex} decimation produced no reduction (before {Before}, after {After}, components {Components}, eligible {Eligible}, min {Min}, max {Max}, avg {Avg:0.##}, eval {Evaluated}, collapsed {Collapsed}, reject bone {RejectBone}, body {RejectBody}, topo {RejectTopo}, invert {RejectInvert} (deg {RejectDeg}, area {RejectArea}, flip {RejectFlip})", meshIndex, triangleCount, @@ -1220,17 +1220,16 @@ internal static class MdlDecimator bodyMeshOverrides = []; var meshCount = Math.Max(0, lodMeshEnd - lodMeshStart); - logger.LogInformation("Body collision: scanning {MeshCount} meshes, {MaterialCount} materials", meshCount, mdl.Materials.Length); + logger.LogDebug("Body collision: scanning {MeshCount} meshes, {MaterialCount} materials", meshCount, mdl.Materials.Length); if (mdl.Materials.Length == 0) { - logger.LogInformation("Body collision: no materials found, skipping body collision."); + logger.LogDebug("Body collision: no materials found, skipping body collision."); return false; } var materialList = string.Join(", ", mdl.Materials); - logger.LogInformation("Body collision: model materials = {Materials}", materialList); - logger.LogDebug("Body collision: model materials (debug) = {Materials}", materialList); + logger.LogDebug("Body collision: model materials = {Materials}", materialList); var proxyTargetRatio = Math.Clamp(Math.Max(settings.TargetRatio, tuning.BodyProxyTargetRatioMin), 0d, 1d); var bodyPositions = new List(); @@ -1244,7 +1243,7 @@ internal static class MdlDecimator ? mdl.Materials[mesh.MaterialIndex] : "(missing material)"; var isBody = IsBodyMaterial(material); - logger.LogInformation("Body collision: mesh {MeshIndex} material {Material} body {IsBody}", meshIndex, material, isBody); + logger.LogDebug("Body collision: mesh {MeshIndex} material {Material} body {IsBody}", meshIndex, material, isBody); if (!isBody) { @@ -1319,7 +1318,7 @@ internal static class MdlDecimator if (!foundBody) { - logger.LogInformation("Body collision: no body meshes matched filter."); + logger.LogDebug("Body collision: no body meshes matched filter."); return false; } diff --git a/LightlessSync/Services/ModelDecimation/ModelDecimationService.cs b/LightlessSync/Services/ModelDecimation/ModelDecimationService.cs index 0195a0c..00406f6 100644 --- a/LightlessSync/Services/ModelDecimation/ModelDecimationService.cs +++ b/LightlessSync/Services/ModelDecimation/ModelDecimationService.cs @@ -51,7 +51,7 @@ public sealed class ModelDecimationService return; } - _logger.LogInformation("Queued model decimation for {Hash}", hash); + _logger.LogDebug("Queued model decimation for {Hash}", hash); _decimationDeduplicator.GetOrStart(hash, async () => { @@ -174,7 +174,7 @@ public sealed class ModelDecimationService { if (!TryGetDecimationSettings(out var settings)) { - _logger.LogInformation("Model decimation disabled or invalid settings for {Hash}", hash); + _logger.LogDebug("Model decimation disabled or invalid settings for {Hash}", hash); return Task.CompletedTask; } @@ -198,11 +198,11 @@ public sealed class ModelDecimationService if (!TryNormalizeSettings(settings, out var normalized)) { - _logger.LogInformation("Model decimation skipped for {Hash}; invalid settings.", hash); + _logger.LogDebug("Model decimation skipped for {Hash}; invalid settings.", hash); return Task.CompletedTask; } - _logger.LogInformation( + _logger.LogDebug( "Starting model decimation for {Hash} (threshold {Threshold}, ratio {Ratio:0.##}, normalize tangents {NormalizeTangents}, avoid body intersection {AvoidBodyIntersection})", hash, normalized.TriangleThreshold, @@ -229,7 +229,7 @@ public sealed class ModelDecimationService if (!MdlDecimator.TryDecimate(sourcePath, destination, normalized, _logger)) { _failedHashes[hash] = 1; - _logger.LogInformation("Model decimation skipped for {Hash}", hash); + _logger.LogDebug("Model decimation skipped for {Hash}", hash); return Task.CompletedTask; } @@ -237,7 +237,7 @@ public sealed class ModelDecimationService { RegisterDecimatedModel(hash, sourcePath, destination); } - _logger.LogInformation("Decimated model {Hash} -> {Path}", hash, destination); + _logger.LogDebug("Decimated model {Hash} -> {Path}", hash, destination); return Task.CompletedTask; }