From fb361547e577c5a0b8ba339476716cad9c721034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Sa=CC=81nchez-Sa=CC=81ez?= Date: Mon, 22 Jun 2015 16:14:16 +0100 Subject: [PATCH] Fix groups being ignored if they have 'usemtl' just before 'g' --- tiny_obj_loader.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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];