VOXELFORMAT: don't hardcode the material index

master
Martin Gerhardy 2022-05-12 00:30:14 +02:00
parent 07eb86f29e
commit 5a9e125874
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,7 @@ bool GLTFFormat::saveMeshes(const core::Map<int, int> &meshIdxNodeMap, const Sce
} else if (withColor) {
meshPrimitive.attributes["COLOR_0"] = primIdxFactor * nthNodeIdx + 2;
}
meshPrimitive.material = 0;
meshPrimitive.material = (int)m.materials.size() - 1;
meshPrimitive.mode = TINYGLTF_MODE_TRIANGLES;
expMesh.primitives.emplace_back(core::move(meshPrimitive));
}