restore group names during obj decoding

This commit is contained in:
Stewart Allen 2022-01-08 21:18:09 -05:00
commit e3b31203c3
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ function load_data(data, file, ext) {
}]); }]);
break; break;
case "obj": case "obj":
resolve(load.OBJ.parse(data).map(m => { return {mesh: m.toFloat32(), file} })); resolve(load.OBJ.parse(data).map(m => { return {mesh: m.toFloat32(), file: m.name || file} }));
break; break;
case "3mf": case "3mf":
load.TMF.parseAsync(data).then((meshes) => { load.TMF.parseAsync(data).then((meshes) => {

View file

@ -54,7 +54,7 @@ function parse(text) {
objs.push(faces = []); objs.push(faces = []);
} }
if (toks[0]) { if (toks[0]) {
faces.name = toks[0]; faces.name = toks.join(' ');
} }
break; break;
} }