--- Operating System, Graphics card ---
Windows 7 64bit, Geforce card
--- Blender version with error, and version that worked ---
2.67 - r58189 (none with bmesh work that I've tested with)
--- Short description of error ---
I run a script that often does: bm.from_mesh(me)
And it crashes from time to time... (I checked and it is this specific function in my script)
I tried running it with: bm = bmesh.from_edit_mesh(me)
And that crashes just as often.
--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
I have not been able to reproduce the crash reliably, but it does happen again and again... often enough to make me file the report. There is no message in the console, blender just closes. There is nothing specific/related in the crash.txt either. I'm still looking for a debug build to test with, but haven't found one yet.
Description
Event Timeline
Additional info: It looks like it happens because sometime before the bm.from_mesh(me)... I did an old-fashioned ob.data.polygons[nr].select = True
Can you include the script? (preferably in a blend, which crashes after multiple executions)
before the script ends, try run bmesh.update_edit_mesh(me)
Hey Cam, thanks for looking at this,
I tried to reproduce the crash in a 10 line script, but to no avail. So the only way I can make it happen is with my overly complex setup with multiple scripts/modules (https://code.google.com/p/macouno/ running the entoforms addon, that requires pretty much everything else. r30 had the crash)... I don't want to have you do all that...
It definitely crashes on the creation of a bmesh: bm.from_mesh(me) and only if some time before I do select a couple faces oldschool like.
Removing lines 630 & 631 fixed the crash (see the diff):
https://code.google.com/p/macouno/source/diff?spec=svn31&r=31&format=side&path=/trunk/Blender/addons/object_entoform.py
The actual crash was on line 23 of this one:
https://code.google.com/p/macouno/source/browse/trunk/Blender/modules/macouno/select_bmesh_faces.py?spec=svn31&r=31
My guess is it has to do with the old stuff not flushing right any more, but I have zero proof of that... just a hunch.
If you give steps to install and redo, it may not matter if the script is complicated, as long as I can redo a crash.
Ok... then...
I attached my crashing file and I re-enabled the crash in my current svn.
1. Get the scripts/addons/modules from: https://code.google.com/p/macouno/
2. enable: Mesh: Bump, Mesh: Cast Loop, Mesh: Distance from cursor, Mesh: grow, Mesh: LoopTools, Mesh: Normal smooth, Mesh: Self Shadow, Object entoform
3. Open crasher.blend and space bar ... entoform
4. Either the script creates a red entoform with 14 legs down one side... or it crashes...
I've not had anyone else try my weird setup before... so... I'm completely not sure this will work.
The problem here is object_entoform.py line 641 -- "p.select = True"
selPolygons is storing pointers to polygons that have been freed & re-allocated by select_bmesh_faces.go() it looks like, this is running put_bmesh().
General solution here is not to mix up bmesh and mesh rna access.
2 solutions
- store faces by index (only works if the faces are _not_ added/removed)
- alternative is you could add a customdata layer which sets values on some faces, editing the bmesh then converting back to a mesh will keep this data.
closing.