Fix groups being ignored if they have 'usemtl' just before 'g'

This commit is contained in:
Ricardo Sánchez-Sáez
2015-06-22 16:14:16 +01:00
parent 805bd814fa
commit fb361547e5

View File

@@ -764,8 +764,10 @@ std::string LoadObj(std::vector<shape_t> &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];