mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
fix buffer resizing to only occur when attribute is present
This commit is contained in:
parent
bb98df38d4
commit
43196cd0a6
1 changed files with 16 additions and 4 deletions
|
@ -362,10 +362,22 @@ ExtractedMesh FBXReader::extractMesh(const FBXNode& object, unsigned int& meshIn
|
|||
QHash<QPair<int, int>, int> materialTextureParts;
|
||||
|
||||
data.extracted.mesh.vertices.resize(numVertices);
|
||||
data.extracted.mesh.normals.resize(numVertices);
|
||||
data.extracted.mesh.texCoords.resize(numVertices);
|
||||
data.extracted.mesh.texCoords1.resize(numVertices);
|
||||
data.extracted.mesh.colors.resize(numVertices);
|
||||
|
||||
if (normalAttribute) {
|
||||
data.extracted.mesh.normals.resize(numVertices);
|
||||
}
|
||||
|
||||
if (texCoordAttribute) {
|
||||
data.extracted.mesh.texCoords.resize(numVertices);
|
||||
}
|
||||
|
||||
if (extraTexCoordAttribute) {
|
||||
data.extracted.mesh.texCoords1.resize(numVertices);
|
||||
}
|
||||
|
||||
if (colorAttribute) {
|
||||
data.extracted.mesh.colors.resize(numVertices);
|
||||
}
|
||||
|
||||
// enumerate the vertices and construct the extracted mesh
|
||||
for (int i = 0; i < numVertices; ++i) {
|
||||
|
|
Loading…
Reference in a new issue