Nascent vertices for mesh

pull/5522/head
Steve M 2024-03-30 08:34:11 -07:00
parent 1afc1d90e7
commit b1bd8d700a
1 changed files with 7 additions and 0 deletions

View File

@ -105,6 +105,13 @@ void USDImporterImplTinyusdz::InternReadFile(
// Export meshes
for (size_t i = 0; i < pScene->mNumMeshes; i++) {
pScene->mMeshes[i] = new aiMesh();
pScene->mMeshes[i]->mNumVertices = render_scene.meshes[i].points.size();
pScene->mMeshes[i]->mVertices = new aiVector3D[pScene->mMeshes[i]->mNumVertices];
for (size_t j = 0; j < pScene->mMeshes[i]->mNumVertices; ++j) {
pScene->mMeshes[i]->mVertices[j].x = render_scene.meshes[i].points[j][0];
pScene->mMeshes[i]->mVertices[j].y = render_scene.meshes[i].points[j][1];
pScene->mMeshes[i]->mVertices[j].z = render_scene.meshes[i].points[j][2];
}
pScene->mRootNode->mMeshes[i] = static_cast<unsigned int>(i);
}
}