Importing STL file fails and produces a python error - Mac #40949
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#40949
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
OS: Mac OSX 10.6.8 (iMac)
RAM: 8gb
Graphics card: ATI Radeon HD 5750
Blender Version
Broken: 2.71 official Mac version
Worked: 2.70 offical
Works also on official Windows version 2.71 running under Parallels Desktop on the same iMac.
Short description of error
When I try to import an STL file, an error message is produced . This originally happened when the STL file was located on a memory stick but I have also tried it when it is located on my desktop and also in my home folder - none of these work. This first happened with a file downloaded from the internet but it also occurs with a STL simple file exported from Blender itself of the default cube - both in ASCII and binary format.
P.S. First time I've reported a bug - hope I did everything correctly.
Changed status to: 'Open'
Added subscriber: @paddy10663
Added subscriber: @mont29
Not quite sure why using mmap to read a file? Looks like it’s generating some issues on OSX…
I've had a go at fixing this and it seems to work on both Windows and Mac Blender 2.71 - not tested Linux. However this is the first time I've done anything like this so I'm at a bit of a loss at what to do now; i.e. how do I submit the potentially fixed script? Could anyone help please?
@paddy10663 just place your modified addon's code here (either as a diff or just whole code), I’ll review it, test under linux, and commit if everything is OK. :)
I've attached the file with the changed code (not quite sure what a diff is or how to make one).
I've removed the use of mmap and replaced it with the 'open' command. There is also a slight increase in speed when importing stl files - in most cases negligible but nice to know.
I'll just reiterate that I am somewhat new to all this; I think I've done everything correctly but please say if I have not.
stl_utils.py
Added subscriber: @guillaum
Yep, replacing mmap stuff by mere plain open was my first idea too, then I thought author must have had some reason to use mmap… :/
Let’s give @guillaum one more week, and if no reactions I’ll simply apply that fix.
Hello,
Sorry for latency in my response.
I used MMAP because on my initials tests it was far more efficient than using many reads. (But keep in mind that my tests where on huge meshs of a few gigabytes). Also, this code was "trivially" ported from my personal base code where I was also working on STL with random access, and mmap is more efficient at random access than a bunch of read.
But if it works efficiently without mmap, of course we can remove mmap.
Good luck on that work, unfortunately I cannot contribute more to it (Time is unavailable and I cannot contribute to project related to CG because of my current work... sorry.)
Thanks @guillaum, will handle that then. :)
This issue was referenced by
a3d8d01b0e
Changed status from 'Open' to: 'Resolved'
Closed by commit
a3d8d01b0e
.