Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit 6a06c29

Browse files
committed
Fix IfcOpenShell#1148. Fix crash when creating drawings on Windows with Blender >= 2.91
1 parent 9dcf44f commit 6a06c29

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/ifcblenderexport/blenderbim/bim/cut_ifc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,20 @@ def get_fresh_cut_polygons(self):
482482

483483
import bpy
484484

485-
multiprocessing.set_executable(bpy.app.binary_path_python)
486-
487-
with multiprocessing.Pool(9) as p:
488-
results = p.map(do_cut, process_data)
489-
for result in results:
490-
polygons = [p for p in result if p["points"]]
485+
if bpy.app.version > (2, 90, 0) and os.name == 'nt':
486+
# See bug #1148
487+
for data in process_data:
488+
results = do_cut(data)
489+
polygons = [r for r in results if r["points"]]
491490
self.cut_polygons.extend(polygons)
491+
else:
492+
multiprocessing.set_executable(bpy.app.binary_path_python)
493+
494+
with multiprocessing.Pool(9) as p:
495+
results = p.map(do_cut, process_data)
496+
for result in results:
497+
polygons = [p for p in result if p["points"]]
498+
self.cut_polygons.extend(polygons)
492499

493500
def get_polygon_metadata(self, polygon, position):
494501
polygon["metadata"] = {"classes": self.get_classes(self.get_ifc_element(polygon["global_id"]), position)}

0 commit comments

Comments
 (0)