Skip to content

Commit 440398b

Browse files
committed
Fix an issue with Penumbra connect derping.
Remove a possibly incorrect additional data toggle in the material save process. Remove Tangent data writing. Copy additional Data for hair upgrades.
1 parent 74e5d01 commit 440398b

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

xivModdingFramework/Materials/FileTypes/Mtrl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,13 @@ public static byte[] XivMtrlToUncompressedMtrl(XivMtrl xivMtrl)
659659
}
660660
if (xivMtrl.ColorSetData != null && xivMtrl.ColorSetData.Count > 0)
661661
{
662-
xivMtrl.AdditionalData[0] |= 0x04;
662+
//xivMtrl.AdditionalData[0] |= 0x04;
663663
}
664664
else
665665
{
666666
unchecked
667667
{
668-
xivMtrl.AdditionalData[0] &= (byte)(~0x04);
668+
//xivMtrl.AdditionalData[0] &= (byte)(~0x04);
669669
}
670670
}
671671

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,12 +2601,13 @@ public static byte[] MakeUncompressedMdlFile(TTModel ttModel, XivMdl ogMdl, Acti
26012601
// Optional/Situational Elements
26022602
if (upgradePrecision)
26032603
{
2604+
/*
26042605
AddVertexHeader(source, new VertexDataStruct()
26052606
{
26062607
DataBlock = 1,
26072608
DataType = VertexDataType.Ubyte4n,
26082609
DataUsage = VertexUsageType.Tangent
2609-
});
2610+
});*/
26102611
}
26112612

26122613
AddVertexHeader(source, new VertexDataStruct()
@@ -3968,7 +3969,7 @@ private static bool WriteVectorData(List<byte> buffer, Dictionary<VertexUsageTyp
39683969
break;
39693970
case VertexUsageType.Tangent:
39703971
value = v.Tangent;
3971-
handedness = !v.Handedness;
3972+
handedness = v.Handedness;
39723973
break;
39733974
default:
39743975
return false;

xivModdingFramework/Mods/EndwalkerUpgrade.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ private static async Task<Dictionary<string, UpgradeInfo>> UpdateEndwalkerHairMa
11271127
var constantBase = await Mtrl.GetXivMtrl(_SampleHair, true, tx);
11281128
var originalConsts = mtrl.ShaderConstants;
11291129
mtrl.ShaderConstants = constantBase.ShaderConstants;
1130+
mtrl.AdditionalData = constantBase.AdditionalData;
11301131

11311132
// Copy the alpha threshold over since the functionality there is unchanged.
11321133
var alpha = originalConsts.FirstOrDefault(x => x.ConstantId == 0x29AC0223);

xivModdingFramework/Mods/FileTypes/PMP.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,17 @@ public static async Task WritePmp(PMPJson pmp, string workingDirectory, string z
779779
var metapath = Path.Combine(workingDirectory, "meta.json");
780780
var defaultModPath = Path.Combine(workingDirectory, "default_mod.json");
781781

782-
if(pmp.Meta.ModTags == null)
782+
783+
var oldJsons = Directory.EnumerateFiles(workingDirectory, "*.json", SearchOption.TopDirectoryOnly);
784+
foreach(var j in oldJsons)
785+
{
786+
if (Path.GetFileName(j).StartsWith("group_"))
787+
{
788+
File.Delete(j);
789+
}
790+
}
791+
792+
if (pmp.Meta.ModTags == null)
783793
{
784794
pmp.Meta.ModTags = new List<string>();
785795
}

0 commit comments

Comments
 (0)