Maniphest T97793

New OBJ importer: default value for missing "vt" values is incorrect (see T68249)
Closed, ResolvedBUG

Assigned To
Aras Pranckevicius (aras_p)
Authored By
Jesse Yurkovich (deadpin)
May 3 2022, 7:40 AM
Tags
  • BF Blender
  • Import/Export
Subscribers
Aras Pranckevicius (aras_p)
Howard Trickey (howardt)
Jesse Yurkovich (deadpin)
Pratik Borhade (PratikPB2123)

Description

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.09

Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-05-02 09:18, hash: rBf0f44fd92f1

Short description of error
Going through old reports. The optional "v" value should be defaulted to 0 but is instead FLT_MAX.

vt u v w

    Vertex statement for both polygonal and free-form geometry.

    Specifies a texture vertex and its coordinates. A 1D texture
    requires only u texture coordinates, a 2D texture requires both u
    and v texture coordinates, and a 3D texture requires all three
    coordinates.

    u is the value for the horizontal direction of the texture.

    v is an optional argument.

    v is the value for the vertical direction of the texture. The
    default is 0.

    w is an optional argument.

    w is a value for the depth of the texture. The default is 0.

Exact steps for others to reproduce the error

  • Import the cube.obj file from T68249
  • Open the UV editor and compare to what the python OBJ importer will show

Caused by the following function which defaults to FLT_MAX instead of 0.0f:

static void geom_add_uv_vertex(const StringRef line, GlobalVertices &r_global_vertices)
{
  float2 uv;
  parse_floats(line, FLT_MAX, uv, 2);
  r_global_vertices.uv_vertices.append(uv);
}

Revisions and Commits

rB Blender
D14826

Event Timeline

Jesse Yurkovich (deadpin) created this task.May 3 2022, 7:40 AM
Pratik Borhade (PratikPB2123) added a subscriber: Pratik Borhade (PratikPB2123).May 3 2022, 8:36 AM
Pratik Borhade (PratikPB2123) changed the task status from Needs Triage to Confirmed.May 3 2022, 8:40 AM
Pratik Borhade (PratikPB2123) triaged this task as High priority.
Pratik Borhade (PratikPB2123) added a project: Import/Export.
Pratik Borhade (PratikPB2123) added subscribers: Howard Trickey (howardt), Aras Pranckevicius (aras_p).
Aras Pranckevicius (aras_p) claimed this task.May 3 2022, 12:32 PM
Aras Pranckevicius (aras_p) changed the subtype of this task from "Report" to "Bug".
Aras Pranckevicius (aras_p) closed this task as Resolved by committing rB5962db093f2f: Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ….May 3 2022, 1:49 PM
Aras Pranckevicius (aras_p) added a commit: rB5962db093f2f: Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ….