mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
Fixed #225
This commit is contained in:
parent
9b1e3435d6
commit
adf39dde27
@ -941,15 +941,7 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Colors
|
#region Colors
|
||||||
if (m_Mesh.m_Colors == null || m_Mesh.m_Colors.Length == 0)
|
if (m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||||
{
|
|
||||||
colorData = new Vector4[m_Mesh.m_VertexCount];
|
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
|
||||||
{
|
|
||||||
colorData[c] = new Vector4(0.5f, 0.5f, 0.5f, 1.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
|
||||||
{
|
{
|
||||||
colorData = new Vector4[m_Mesh.m_VertexCount];
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
@ -961,7 +953,7 @@ namespace AssetStudio
|
|||||||
1.0f);
|
1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 4)
|
||||||
{
|
{
|
||||||
colorData = new Vector4[m_Mesh.m_VertexCount];
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
@ -973,6 +965,14 @@ namespace AssetStudio
|
|||||||
m_Mesh.m_Colors[c * 4 + 3]);
|
m_Mesh.m_Colors[c * 4 + 3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||||
|
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||||
|
{
|
||||||
|
colorData[c] = new Vector4(0.5f, 0.5f, 0.5f, 1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
glControl1.Visible = true;
|
glControl1.Visible = true;
|
||||||
createVAO();
|
createVAO();
|
||||||
|
@ -803,7 +803,7 @@ namespace AssetStudio
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Colors
|
#region Colors
|
||||||
if ((bool)Properties.Settings.Default["exportColors"] && m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length > 0)
|
if ((bool)Properties.Settings.Default["exportColors"] && m_Mesh.m_Colors != null && (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3 || m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 4))
|
||||||
{
|
{
|
||||||
ob.Append("\n\t\tLayerElementColor: 0 {");
|
ob.Append("\n\t\tLayerElementColor: 0 {");
|
||||||
ob.Append("\n\t\t\tVersion: 101");
|
ob.Append("\n\t\t\tVersion: 101");
|
||||||
|
@ -270,7 +270,7 @@ namespace AssetStudio
|
|||||||
ImportedMaterial iMat = ConvertMaterial(mat);
|
ImportedMaterial iMat = ConvertMaterial(mat);
|
||||||
iSubmesh.Material = iMat.Name;
|
iSubmesh.Material = iMat.Name;
|
||||||
iSubmesh.VertexList = new List<ImportedVertex>((int)submesh.vertexCount);
|
iSubmesh.VertexList = new List<ImportedVertex>((int)submesh.vertexCount);
|
||||||
var vertexColours = mesh.m_Colors != null && mesh.m_Colors.Length > 0;
|
var vertexColours = mesh.m_Colors != null && (mesh.m_Colors.Length == mesh.m_VertexCount * 3 || mesh.m_Colors.Length == mesh.m_VertexCount * 4);
|
||||||
for (var j = mesh.m_SubMeshes[i].firstVertex; j < mesh.m_SubMeshes[i].firstVertex + mesh.m_SubMeshes[i].vertexCount; j++)
|
for (var j = mesh.m_SubMeshes[i].firstVertex; j < mesh.m_SubMeshes[i].firstVertex + mesh.m_SubMeshes[i].vertexCount; j++)
|
||||||
{
|
{
|
||||||
var iVertex = vertexColours ? new ImportedVertexWithColour() : new ImportedVertex();
|
var iVertex = vertexColours ? new ImportedVertexWithColour() : new ImportedVertex();
|
||||||
|
Loading…
Reference in New Issue
Block a user