Skip to content

Issue parsing faces with less than three components #2

@bostelk

Description

@bostelk

I ran into an issue where the face indices are incorrect for files with less than three face components. Specifically, it incorrectly to parsed this face format: "f v1/vt1 v2/vt2 v3/vt3".

I figured I'd share this small patch which fixes this specific case (unsure if these face formats are supported, but I imagine so).

The patch:

             if (c0 != '/' && comp_count % 3 != 0 && comp_count < face_width * face_comp_count)
             {
-                comp_count += 2;
-                c0 = p_string[++index];
+               comp_count += face_comp_count - (comp_count % 3);
+                if (c0 != '\n')
+                {
+                    c0 = p_string[++index];
+                }
             }
             else if (c0 != '\n')
                 c0 = p_string[++index];```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions