Fix: Support uint16 indices in OpenGEX as well (#6137)

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
This commit is contained in:
Kim Kulling
2025-05-07 10:15:54 +02:00
committed by GitHub
parent af352d6f7c
commit 2056679e98

View File

@@ -913,7 +913,13 @@ void OpenGEXImporter::handleIndexArrayNode(ODDLParser::DDLNode *node, aiScene *
current.mIndices = new unsigned int[current.mNumIndices];
Value *next(vaList->m_dataList);
for (size_t indices = 0; indices < current.mNumIndices; indices++) {
const int idx(next->getUnsignedInt32());
int idx = -1;
if (next->m_type == Value::ValueType::ddl_unsigned_int16) {
idx = next->getUnsignedInt16();
} else if (next->m_type == Value::ValueType::ddl_unsigned_int32) {
idx = next->getUnsignedInt32();
}
ai_assert(static_cast<size_t>(idx) <= m_currentVertices.m_vertices.size());
ai_assert(index < m_currentMesh->mNumVertices);
aiVector3D &pos = (m_currentVertices.m_vertices[idx]);