bugs in io_scene_obj addons #46165
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#46165
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Broken for 2.74, 2.75 and 2.76
When I try to import an obj file, which is said to be exported by zmodeler, I get this
[quote]
import_obj.py", line 796, in
ValueError: could not convert string to float: b'1.#QNAN'
[/quote]
Then I checked the obj file and found something like following
[quote]
vn 1.#QNAN -1.#IND -1.#IND
vn 0.970273 0.199445 -0.137085
vn 1.#QNAN -1.#IND -1.#IND
vn 0.894082 0.387011 -0.225478
vn 1.#QNAN -1.#IND -1.#IND
[/quote]
So I changed 2 lines in "def get_float_func(filepath):". Because '1.' is placed before 'QNAN', I think the change can be done by simple replace
[quote please remember this line appears twice]
return float
[/quote]
with
[quote]
return lambda f: float(f.upper().replace(b'.#QNAN', b'').replace(b'.#IND', b'').replace(b'.#NAN', b''))
[/quote]
But this should be checked wether it is a univerisal way to deal with all 'QNAN' and 'IND'.
And I when I checked scripts\addons\io_scene_obj\import_obj.py in blender 2.74/2.75/2.76, I found that all of them share the same 'get_float_func' function. So the fix will be possible for 2.74/2.75/2.76
Thanks.
Changed status to: 'Open'
Added subscriber: @retsyo
blender/blender#55265 was marked as duplicate of this issue
#54403 was marked as duplicate of this issue
how about ignore the normal if the value is invalid, and do a 'calculate the normal' after importation?
Added subscriber: @mont29
Yeah… never saw such thing in an .OBJ file, and pretty sure this is not covered by the format definition at all. In fact, this heavily looks like a bug in zmodeler exporter to me. Anyway, will add some more safety checks here…
Added subscriber: @ideasman42
OK, have a patch which basically uses try/except around float 'parsing' func… Makes parsing of the file about 4-5% slower though (total import about 2-3% slower).
Would like to summon @ideasman42 here though, I really do not feel like adding that extra stuff for what is quite obviously a broken file - we cannot support all stupidity of external app world in Blender, and think we can expect a reasonable level of format-correctness for our importers?
Note that those
1.#QNAN
,-1.#IND
etc. are windows-version ofnan
andinf
, that is, invalid of infinite numbers. Think those should never ever be exported in an .obj!Changed status from 'Open' to: 'Archived'
So, talked with Campbell on IRC, we agree that we shall not try to support broken .obj (if we start there, we'll never end), bug is in the app that is exporting such files, not in Blender anyway.
note that you could report a bug to zmodeler instead. such files shouldn't be written.
Added subscriber: @YegorSmirnov
Added subscriber: @Siccity