fix log level
This commit is contained in:
@@ -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<Vector3d>();
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user