Skip to content

Commit 8340d93

Browse files
committed
More consistency checks and validation on ensuring models are always exported with the correct skin material (and that skin material is correctly passed to the exporters)
1 parent e470731 commit 8340d93

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ public async Task ExportModel(TTModel model, string outputFilePath, int mtrlVari
217217
// Pop the textures out so the exporters can reference them.
218218
if (includeTextures)
219219
{
220+
// Fix up our skin references in the model before exporting, to ensure
221+
// we supply the right material names to the exporters down-chain.
222+
if (model.IsInternal)
223+
{
224+
ModelModifiers.FixUpSkinReferences(model, model.Source, null);
225+
}
220226
await ExportMaterialsForModel(model, outputFilePath, _gameDirectory, mtrlVariant);
221227
}
222228

xivModdingFramework/Models/Helpers/ModelModifiers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,10 @@ public static void CalculateTangentsFromBinormals(TTModel model, Action<bool, st
11441144
/// <param name="newInternalPath"></param>
11451145
public static void FixUpSkinReferences(TTModel model, string newInternalPath, Action<bool, string> loggingFunction = null)
11461146
{
1147+
if (loggingFunction == null)
1148+
{
1149+
loggingFunction = NoOp;
1150+
}
11471151

11481152
// Here we should to go in and correct any Skin Material references to point to the skin material for this race.
11491153
// It's not actually -NEEDED-, as the game will dynamically resolve them anyways to the player's skin material, but it's good for user expectation and sanity.

0 commit comments

Comments
 (0)