Maniphest T49865

export .obj broke UVs
Closed, Resolved

Assigned To
Bastien Montagne (mont29)
Authored By
Massimiliano Puliero (mmaaxx)
Oct 28 2016, 8:49 AM
Tags
  • Import/Export
  • Add-ons (Community)
Subscribers
Bastien Montagne (mont29)
Massimiliano Puliero (mmaaxx)

Description

System Information
win7 64 k2200

Blender Version
Broken: 2.78a
Worked: 2.76

Short description of error
export OBJ corrupt a little bit the uv, no problem with FBX.

Exact steps for others to reproduce the error
open the file, export the monkey in obj format, import again in blender and compare the uvs (by merging the two objects). you can notice a slight difference.

thankyou!

Revisions and Commits

rBA Blender Add-ons

Related Objects

Mentioned Here
rBAc553d7c0eb00: Avoid writing redundant zeros
rBA887fad6a0196: Fix T39879: extra UV seams where meshes overlap.
T39879: extra UV seams where meshes overlap

Event Timeline

Massimiliano Puliero (mmaaxx) created this task.Oct 28 2016, 8:49 AM
Vuk Gardašević (lijenstina) edited projects, added Import/Export, Add-ons (Community); removed BF Blender.Oct 28 2016, 9:50 PM
Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.Oct 29 2016, 9:12 AM
Bastien Montagne (mont29) claimed this task.
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).

Thanks for the report, but that’s not really a bug here, issue is, OBJ being a pure textual format, we have to round float numbers (to the forth decimal currently) to avoid generating insanely big files. This of course involves a small loss of data - that’s why binary formats (like FBX) should be used when in need of full float precision.

Massimiliano Puliero (mmaaxx) added a comment.Oct 29 2016, 11:22 AM

Thanks for the reply,

But objects exported with Blender 2.77 or 2.76 doesn't give me the same error.
can you please take a look into it.

thanks again.

Massimiliano Puliero (mmaaxx) added a comment.Oct 29 2016, 11:43 AM

I copied the 'io_scene_obj' folder from 2.77 and pasted in 2,78, now Blender export the uvs correctly.

I compared the 2 codes and I see some differences on line 575 and 546

Blender 2.77
fw('vt %.6f %.6f\n' % uv[:])

Blender 2.78
fw('vt %.4f %.4f\n' % uv[:])

thankyou

Bastien Montagne (mont29) changed the task status from Archived to Unknown Status.Oct 30 2016, 8:40 AM
Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.

Changes comes from rBA887fad6a0196be (fixing T39879).

That’s the usual trade-of of float precision here actually, too much precision might make UV points actually merged look like split (due to errors introduced during float computation), too low precision will reduce exactness…

Fixing T39879 could also be done by using a 'limited-precision comparison' instead of exact comparison, afraid it will makes things slower though… Will investigate further.

Bastien Montagne (mont29) added a comment.EditedOct 30 2016, 12:43 PM

Uh, actually, was wrong it’s rBAc553d7c0eb002 the culprit here… Not totally sure why precision was reduced here, so will restore it back to 6 decimals for now.

Bastien Montagne (mont29) changed the task status from Unknown Status to Resolved by committing rBAafde50f68185: Fix T49865: export .obj broke UVs..Oct 30 2016, 12:49 PM
Bastien Montagne (mont29) added a commit: rBAafde50f68185: Fix T49865: export .obj broke UVs..