Skip to content

Commit

Permalink
File validation: Fixed appearance name check in .app file for dynamic…
Browse files Browse the repository at this point in the history
… variant suffixes
  • Loading branch information
manavortex committed Jan 4, 2024
1 parent ca6529a commit c171ba1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Scripts/Wolvenkit_FileValidation.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ function appFile_validatePartsOverride(override, index, appearanceName) {
}

if (isDynamicAppearance && depotPath && shouldHaveSubstitution(depotPath)) {
Logger.Warning(`${info}: Substitution in depot path not supported.`);
Logger.Warning(`${info}: Substitution for depot path not supported in .app files, use mesh_entity.`);
}

const appFilePath = pathToCurrentFile;
Expand Down Expand Up @@ -1163,11 +1163,12 @@ function entFile_validateAppearance(appearance) {
const entFilePath = pathToCurrentFile;
pathToCurrentFile = appFilePath;

const namesInAppFile = getAppearanceNamesInAppFile(appFilePath, appearanceName) || [];

// if we're being dynamic here, also check for appearance names with suffixes.
if (!namesInAppFile.includes(appearanceNameInAppFile)
&& (!isDynamicAppearance || !namesInAppFile.includes(appearanceNameInAppFile.split('&').pop() || ''))
const namesInAppFile = getAppearanceNamesInAppFile(appFilePath, appearanceName) || []

const dynamicNamesInAppFile = namesInAppFile.map((name) => name.split('&')[0]);
if (!namesInAppFile.includes(appearanceNameInAppFile) &&
(!isDynamicAppearance || !dynamicNamesInAppFile.includes(appearanceNameInAppFile))
) {
entAppearancesNotFoundByFile[appFilePath] ||= {};
entAppearancesNotFoundByFile[appFilePath][appearanceName] = appearanceNameInAppFile;
Expand Down

0 comments on commit c171ba1

Please sign in to comment.