jonnenauha/obj-simplify

Comments (#) aren't supported.

Closed this issue · 2 comments

According to the OBJ spec linked on the main page, comment lines should be ignored, but they aren't. Instead, the program just bombs:

[FATAL] line:4 Unsupported line "#98 vertices, 124 faces"

Please submit a bug report. If you can, provide this file as an attachement.
> https://github.com/jonnenauha/obj-simplify/issues

It is supported https://github.com/jonnenauha/obj-simplify/blob/master/objectfile/structs.go#L93-L96

But seems that if there is no space after the # it will bork

obj-simplify/obj-parser.go

Lines 194 to 201 in e8ec722

func parseLineType(str string) (objectfile.Type, string) {
value := ""
if i := strings.Index(str, " "); i != -1 {
value = strings.TrimSpace(str[i+1:])
str = str[0:i]
}
return objectfile.TypeFromString(str), value
}

Thanks for the report, I'll fix it.