Skip to content

Commit

Permalink
disabled generated chunk material warnings
Browse files Browse the repository at this point in the history
if appearances have no chunks, ArchiveXL will generate material assignments based on the first appearance
  • Loading branch information
manavortex committed Jun 19, 2024
1 parent 9c8e36b commit 6a2c8fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Scripts/Wolvenkit_FileValidation.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
}
Expand Down

0 comments on commit 6a2c8fa

Please sign in to comment.