Maniphest T96430

OBJ Export: wrong normals with scaled object
Closed, ResolvedBUG

Assigned To
Howard Trickey (howardt)
Authored By
Scurest (scurest)
Mar 14 2022, 12:13 PM
Tags
  • BF Blender
  • Import/Export
  • Pipeline, Assets & I/O
Subscribers
Aras Pranckevicius (aras_p)
Howard Trickey (howardt)
Scurest (scurest)

Description

System Information
Operating system: Linux
Graphics card:

Blender Version
Broken: 3.1
Worked: 3.0

Short description of error

When exporting an OBJ, if a mesh object has a non-trivial scaling in its world matrix, the normals are wrong

  • the normals are not normalized (unit length)
  • non-uniform scaling aren't handled correctly (inverse-transpose formula)

Exact steps for others to reproduce the error

Create a UV sphere, smooth shade it, scale down on one axis, say Scale X = 0.3. Export and reimport.

Revisions and Commits

rB Blender
D14343

Event Timeline

Scurest (scurest) created this task.Mar 14 2022, 12:13 PM
Aras Pranckevicius (aras_p) added a subscriber: Aras Pranckevicius (aras_p).Mar 14 2022, 12:18 PM
Aras Pranckevicius (aras_p) changed the task status from Needs Triage to Confirmed.Mar 14 2022, 7:36 PM
Aras Pranckevicius (aras_p) claimed this task.

Yup, can reproduce this. Looks like the new exporter is not applying proper normal transformation math (should use inverse transpose of the matrix, and normalize the result). Will try fixing...

Aras Pranckevicius (aras_p) added projects: Import/Export, Pipeline, Assets & I/O.Mar 14 2022, 8:56 PM
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".Mar 15 2022, 5:44 PM
Bastien Montagne (mont29) moved this task from Backlog to Bugs on the Pipeline, Assets & I/O board.
Howard Trickey (howardt) claimed this task.Mar 19 2022, 9:06 PM
Howard Trickey (howardt) added a subscriber: Howard Trickey (howardt).

This looks good.

Howard Trickey (howardt) closed this task as Resolved by committing rB8aa365745a78: Fix T96430: new OBJ exporter wrong normals for non-uniform scale, and wrong….Mar 19 2022, 9:24 PM
Howard Trickey (howardt) added a commit: rB8aa365745a78: Fix T96430: new OBJ exporter wrong normals for non-uniform scale, and wrong….
Aras Pranckevicius (aras_p) added a commit: rB3a1e6bc1d580: Fix T96430: new OBJ exporter wrong normals for non-uniform scale, and wrong….Mar 23 2022, 12:23 PM