Bone and Material Limit updates.

Fix UI in Models tab to allow for more than 4 Materials per DT spec.
This commit is contained in:
Theo 2024-12-16 19:11:46 -08:00 committed by Ottermandias
parent ac64b4db24
commit b0a8b1baa5
2 changed files with 8 additions and 8 deletions

View file

@ -208,10 +208,10 @@ public partial class ModelImporter(ModelRoot model, IoNotifier notifier)
if (index >= 0)
return (ushort)index;
// If there's already 4 materials, we can't add any more.
// If there's already 10 materials, we can't add any more.
// TODO: permit, with a warning to reduce, and validation in MdlTab.
var count = _materials.Count;
if (count >= 4)
if (count >= 10)
return 0;
_materials.Add(materialName);
@ -234,10 +234,10 @@ public partial class ModelImporter(ModelRoot model, IoNotifier notifier)
boneIndices.Add((ushort)boneIndex);
}
if (boneIndices.Count > 64)
throw notifier.Exception("XIV does not support meshes weighted to a total of more than 64 bones.");
if (boneIndices.Count > 128)
throw notifier.Exception("XIV does not support meshes weighted to a total of more than 128 bones.");
var boneIndicesArray = new ushort[64];
var boneIndicesArray = new ushort[128];
Array.Copy(boneIndices.ToArray(), boneIndicesArray, boneIndices.Count);
var boneTableIndex = _boneTables.Count;

View file

@ -16,7 +16,7 @@ namespace Penumbra.UI.AdvancedWindow;
public partial class ModEditWindow
{
private const int MdlMaterialMaximum = 4;
private const int MdlMaterialMaximum = 10;
private const string MdlImportDocumentation =
@"https://github.com/xivdev/Penumbra/wiki/Model-IO#user-content-9b49d296-23ab-410a-845b-a3be769b71ea";