Merge pull request #44 from obviousengineering/oe

Fix groups being ignored if they have 'usemtl' just before 'g'
This commit is contained in:
Syoyo Fujita
2015-06-23 16:14:59 +09:00

View File

@@ -764,8 +764,10 @@ std::string LoadObj(std::vector<shape_t> &shapes,
bool ret = exportFaceGroupToShape(shape, vertexCache, v, vn, vt, bool ret = exportFaceGroupToShape(shape, vertexCache, v, vn, vt,
faceGroup, material, name, true); faceGroup, material, name, true);
if (ret) { if (ret) {
faceGroup.clear(); shapes.push_back(shape);
} }
shape = shape_t();
faceGroup.clear();
if (material_map.find(namebuf) != material_map.end()) { if (material_map.find(namebuf) != material_map.end()) {
material = material_map[namebuf]; material = material_map[namebuf];