mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +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 },
|
||||
});
|
||||
|
||||
var attributes = Enumerable.Range(0, 32)
|
||||
.Where(index => ((attributeMask >> index) & 1) == 1)
|
||||
.Select(index => _mdl.Attributes[index])
|
||||
.ToArray();
|
||||
string[] attributes = [];
|
||||
var maxAttribute = 31 - BitOperations.LeadingZeroCount(attributeMask);
|
||||
if (maxAttribute < _mdl.Attributes.Length)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue