From 6a2c8fa45856a56c6e64ef2470fa496ec6e195b2 Mon Sep 17 00:00:00 2001 From: manavortex Date: Wed, 19 Jun 2024 11:21:56 +0200 Subject: [PATCH] disabled generated chunk material warnings if appearances have no chunks, ArchiveXL will generate material assignments based on the first appearance --- Scripts/Wolvenkit_FileValidation.wscript | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Scripts/Wolvenkit_FileValidation.wscript b/Scripts/Wolvenkit_FileValidation.wscript index 9163b33..8be0c22 100644 --- a/Scripts/Wolvenkit_FileValidation.wscript +++ b/Scripts/Wolvenkit_FileValidation.wscript @@ -1667,12 +1667,18 @@ export function validateMeshFile(mesh, _meshSettings) { if (mesh.renderResourceBlob !== "undefined") { numSubMeshes = mesh.renderResourceBlob?.Data?.header?.renderChunkInfos?.length; } - + + if (mesh.appearances.length === 0) return; + const firstMaterialHasChunks = (mesh.appearances[0].Data.chunkMaterials || []).length >= numSubMeshes; + for (let i = 0; i < mesh.appearances.length; i++) { let invisibleSubmeshes = []; let appearance = mesh.appearances[i].Data; const appearanceName = stringifyPotentialCName(appearance.name); const numAppearanceChunks = (appearance.chunkMaterials || []).length + if (firstMaterialHasChunks && numAppearanceChunks === 0) { + continue; + } if (appearanceName && numAppearanceChunks > 0 && !PLACEHOLDER_NAME_REGEX.test(appearanceName) && numSubMeshes > numAppearanceChunks) { Logger.Warning(`Appearance ${appearanceName} has only ${appearance.chunkMaterials.length} of ${numSubMeshes} submesh appearances assigned. Meshes without appearances will render as invisible.`); }