.obj import error with mtllib name in quotes - regression from 2.79b #67266
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#67266
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?
System Information
Operating system: Windows 10 64 bit
Graphics card: GeForce GTX 1080 Ti
Blender Version
Broken: 2.80 c2e8e249acf9
Worked: 2.79b f4dc9f9d68b
Short description of error
Blender 2.8 can't import .obj files that contain an mtllib with quotes. While not mentioned in the .obj specification, it seems some software uses quotes when the filename contains blanks. These kind of .obj files could be imported by Blender 2.79b, but the current master branch of 2.8 throws a
FileNotFoundError
.Excerpt of the problematic .obj file:
Exact steps for others to reproduce the error
name with blanks.mtl
name with blanks.obj
Added subscriber: @rjg
Technically this isn't a bug, since Blender follows the spec. However it may still be useful to support this as it was in 2.79b. This issue was originally brought to my intention in this post on Blender StackExchange . The software that created the problematic .obj file was Agisoft Metashape.
Looking at the code of
import_obj.py
from 2.79b it seems that this may not have been an intended feature.If this is of interest, it could be easily fixed by changing line 1151 from:
to something like:
The same issue applies to .mtl files with
map_Kd
and a texture filename in quotes.Added subscriber: @mont29
Indeed, even though that’s not a bug, it does not cost much to support it either… Will commit, thanks for the initial report & investigations.
You're very welcome. Always happy to help and contribute.
Just noticed that this might be a bit more complex to solve in general because
"
could be a legitimate character in Linux and macOS file names.I would not care much about that… having spaces in filenames is already a bad and annoying habit, but someone putting a quote (single or double) in a file name only deserves what they will get (and a good spanking on top of it ;) ).
This issue was referenced by
05dc8caa35
Changed status from 'Open' to: 'Resolved'
Can't argue with that. Thank you!
Added subscriber: @darthhawk
The modeler I use doesn't put quotation marks in the OBJ file and Blender has issues importing OBJ files.
I get the following error on trying to import obj files. Other modelers I use don't have this problem.
@darthhawk Please create a new ticket for your issue through Help > Report a Bug in Blender and generate a minimal .obj example file that results in the described problem when imported.