void glTFExporter::ExportMeshes()
{
+ std::string bufferId = mAsset->FindUniqueID("", "buffer");
+
+ Ref<Buffer> b = mAsset->GetBodyBuffer();
+ if (!b) {
+ b = mAsset->buffers.Create(bufferId);
+ }
+
for (unsigned int i = 0; i < mScene->mNumMeshes; ++i) {
const aiMesh* aim = mScene->mMeshes[i];
p.material = mAsset->materials.Get(aim->mMaterialIndex);
- std::string bufferId = mAsset->FindUniqueID(meshId, "buffer");
-
- Ref<Buffer> b = mAsset->GetBodyBuffer();
- if (!b) {
- b = mAsset->buffers.Create(bufferId);
- }
-
Ref<Accessor> v = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mVertices, AttribType::VEC3, AttribType::VEC3, ComponentType_FLOAT);
if (v) p.attributes.position.push_back(v);