mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 12:44:19 +01:00
Ignore invalid attributes on export
This commit is contained in:
parent
6693a1e0ba
commit
72775a80bf
1 changed files with 13 additions and 4 deletions
|
|
@ -230,10 +230,19 @@ public class MeshExporter
|
||||||
{ "targetNames", shapeNames },
|
{ "targetNames", shapeNames },
|
||||||
});
|
});
|
||||||
|
|
||||||
var attributes = Enumerable.Range(0, 32)
|
string[] attributes = [];
|
||||||
.Where(index => ((attributeMask >> index) & 1) == 1)
|
var maxAttribute = 31 - BitOperations.LeadingZeroCount(attributeMask);
|
||||||
.Select(index => _mdl.Attributes[index])
|
if (maxAttribute < _mdl.Attributes.Length)
|
||||||
.ToArray();
|
{
|
||||||
|
attributes = Enumerable.Range(0, 32)
|
||||||
|
.Where(index => ((attributeMask >> index) & 1) == 1)
|
||||||
|
.Select(index => _mdl.Attributes[index])
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_notifier.Warning($"Invalid attribute data, ignoring.");
|
||||||
|
}
|
||||||
|
|
||||||
return new MeshData
|
return new MeshData
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue