diff --git a/tiny_obj_loader.cc b/tiny_obj_loader.cc index 323573d..5f6359d 100644 --- a/tiny_obj_loader.cc +++ b/tiny_obj_loader.cc @@ -764,8 +764,10 @@ std::string LoadObj(std::vector &shapes, bool ret = exportFaceGroupToShape(shape, vertexCache, v, vn, vt, faceGroup, material, name, true); if (ret) { - faceGroup.clear(); + shapes.push_back(shape); } + shape = shape_t(); + faceGroup.clear(); if (material_map.find(namebuf) != material_map.end()) { material = material_map[namebuf];