Blender not importing .obj files #94741

Closed
opened 2022-01-08 17:04:26 +01:00 by John Smith · 8 comments

System Information
Operating system: macOS-12.1-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 575X OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.7.101

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: blender/blender@f1cca30557

Short description of error
Other people have reported this kind of bug and have been dismissed out of hand for being newbies who just don't have the needed skills to find the imported object after it's been brought into Blender. Please don't do that. It's true that I am a newbie, but I have sought advice on the community page and the suggestions made there don't help. Furthermore, I have reason to believe that Blender is NOT importing the object or objects in the .obj files I have tried to import. The same files can be imported into Cheetah3d without problem, but not Blender. Isn't that a bug?

Exact steps for others to reproduce the error

  1. Create .obj file by exporting an object from my old modeling app (Carrara). 2. Open Blender to default startup and press Cntl-Option-Q to split main window into 4 viewpoints (that last part is not essential). 3. Move default cube to one side. 4. File-Import-Wavefront (.obj), select newly created .obj file: The "object" appears in the Outliner, but isn't visible in the 3D view or in the top, front, side views. 5. Select default cube in the Outliner, then move cursor over 3d view and press Numpad period: view centers on cube and zooms in. Select imported object in Outliner, then move cursor over 3d view and press Numpad period: view centers on the origin (x=0, y=0, z=0). No object is visible. 6. Zoom in or out: no object is visible. 7. Scale to 1000: no object is visible. Scale to 0.01: no object is visible. NOTE: Other test .obj files contain mulitple objects. When imported into Cheetah3d, those individual objects are listed in the objects list. In Blender, I would have expected to see them somewhere (in the Outliner, maybe?), but they do not seem to appear. Cheetah3d can open these .obj files seemingly without any issue. Blender is supposed to be able to open .obj files, but it doesn't seem to be opening these. Isn't that a bug?

[Based on the default startup or an attached .blend file (as simple as possible)]SphereandCubeandSphere.obj

Boolean_Cheetah3d.jpg

Boolean_Blender.jpg

CubeBuilding_Cheetah3d.jpg

CubeBuilding_Blender.jpg

**System Information** Operating system: macOS-12.1-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 575X OpenGL Engine ATI Technologies Inc. 4.1 ATI-4.7.101 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `blender/blender@f1cca30557` **Short description of error** Other people have reported this kind of bug and have been dismissed out of hand for being newbies who just don't have the needed skills to find the imported object after it's been brought into Blender. Please don't do that. It's true that I am a newbie, but I have sought advice on the community page and the suggestions made there don't help. Furthermore, I have reason to believe that Blender is NOT importing the object or objects in the .obj files I have tried to import. The same files can be imported into Cheetah3d without problem, but not Blender. Isn't that a bug? **Exact steps for others to reproduce the error** 1. Create .obj file by exporting an object from my old modeling app (Carrara). 2. Open Blender to default startup and press Cntl-Option-Q to split main window into 4 viewpoints (that last part is not essential). 3. Move default cube to one side. 4. File-Import-Wavefront (.obj), select newly created .obj file: The "object" appears in the Outliner, but isn't visible in the 3D view or in the top, front, side views. 5. Select default cube in the Outliner, then move cursor over 3d view and press Numpad period: view centers on cube and zooms in. Select imported object in Outliner, then move cursor over 3d view and press Numpad period: view centers on the origin (x=0, y=0, z=0). No object is visible. 6. Zoom in or out: no object is visible. 7. Scale to 1000: no object is visible. Scale to 0.01: no object is visible. NOTE: Other test .obj files contain mulitple objects. When imported into Cheetah3d, those individual objects are listed in the objects list. In Blender, I would have expected to see them somewhere (in the Outliner, maybe?), but they do not seem to appear. Cheetah3d can open these .obj files seemingly without any issue. Blender is supposed to be able to open .obj files, but it doesn't seem to be opening these. Isn't that a bug? [Based on the default startup or an attached .blend file (as simple as possible)][SphereandCubeandSphere.obj](https://archive.blender.org/developer/F12796094/SphereandCubeandSphere.obj) ![Boolean_Cheetah3d.jpg](https://archive.blender.org/developer/F12796096/Boolean_Cheetah3d.jpg) ![Boolean_Blender.jpg](https://archive.blender.org/developer/F12796095/Boolean_Blender.jpg) ![CubeBuilding_Cheetah3d.jpg](https://archive.blender.org/developer/F12796100/CubeBuilding_Cheetah3d.jpg) ![CubeBuilding_Blender.jpg](https://archive.blender.org/developer/F12796099/CubeBuilding_Blender.jpg)
Author

Added subscriber: @johnsmithmd00001

Added subscriber: @johnsmithmd00001

Added subscriber: @scurest

Added subscriber: @scurest

Your .obj file uses carriage return, \r, as the newline delimiter instead of the usual \n or \r\n. The Python importer opens files in binary mode and Python says "the line terminator is always b'\n' for binary files". It therefore interprets your entire file as a single very long comment line. I think there is a new OBJ importer under way, perhaps it works there. But you can fix the line endings in practically any text editor to get it to import right now.

(Btw, you can easily check if any verts were imported at all using the stats in the statusbar.)

Your .obj file uses carriage return, `\r`, as the newline delimiter instead of the usual `\n` or `\r\n`. The Python importer opens files in binary mode and Python says ["the line terminator is always b'\n' for binary files"](https://docs.python.org/3/library/io.html#io.IOBase.readline). It therefore interprets your entire file as a single very long comment line. I think there is a new OBJ importer under way, perhaps it works there. But you can fix the line endings in practically any text editor to get it to import right now. (Btw, you can easily check if any verts were imported at all using the stats in the statusbar.)
Author

"But you can fix the line endings in practically any text editor to get it to import right now."

Thanks for the suggestion, but unfortunately, that's not in my skill set. The only text editor I have is Atom, which I have previously used only to write Python programs, and not very recently. I opened the .obj file in Atom and I don't see "\r" anywhere. Nor do I see any way to identify newline delimiters, however they might appear. Hence, I have no clue how to edit the file as you suggested.

(I also don't know how to find the statusbar, though I think I might be able to figure that one out.)

"But you can fix the line endings in practically any text editor to get it to import right now." Thanks for the suggestion, but unfortunately, that's not in my skill set. The only text editor I have is Atom, which I have previously used only to write Python programs, and not very recently. I opened the .obj file in Atom and I don't see "\r" anywhere. Nor do I see any way to identify newline delimiters, however they might appear. Hence, I have no clue how to edit the file as you suggested. (I also don't know how to find the statusbar, though I think I might be able to figure that one out.)
Author

Oh.

I opened the .obj file in an app called CotEditor. At the bottom of the window was a box that said "CR." The other options were "LF" and "CRLF." I changed the setting to "LF," waited for the file to be rewritten, then closed without saving. And just like that, the file could be imported into Blender.

Not that my problems are over. The file I really want to bring into Blender did not come in intact. But at least something came in. That's progress, I suppose.

Oh. I opened the .obj file in an app called CotEditor. At the bottom of the window was a box that said "CR." The other options were "LF" and "CRLF." I changed the setting to "LF," waited for the file to be rewritten, then closed without saving. And just like that, the file could be imported into Blender. Not that my problems are over. The file I really want to bring into Blender did not come in intact. But at least something came in. That's progress, I suppose.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Philipp Oeser self-assigned this 2022-01-27 14:19:03 +01:00
Member

And just like that, the file could be imported into Blender.

So that makes this report Resolved I think.

Not that my problems are over. The file I really want to bring into Blender did not come in intact. But at least something came in. That's progress, I suppose.

Please open a new report for this.

> And just like that, the file could be imported into Blender. So that makes this report Resolved I think. > Not that my problems are over. The file I really want to bring into Blender did not come in intact. But at least something came in. That's progress, I suppose. Please open a new report for this.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#94741
No description provided.