mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Fix #1148. Fix crash when creating drawings on Windows with Blender >= 2.91
This commit is contained in:
@@ -482,13 +482,20 @@ class IfcCutter:
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
multiprocessing.set_executable(bpy.app.binary_path_python)
|
if bpy.app.version > (2, 90, 0) and os.name == 'nt':
|
||||||
|
# See bug #1148
|
||||||
with multiprocessing.Pool(9) as p:
|
for data in process_data:
|
||||||
results = p.map(do_cut, process_data)
|
results = do_cut(data)
|
||||||
for result in results:
|
polygons = [r for r in results if r["points"]]
|
||||||
polygons = [p for p in result if p["points"]]
|
|
||||||
self.cut_polygons.extend(polygons)
|
self.cut_polygons.extend(polygons)
|
||||||
|
else:
|
||||||
|
multiprocessing.set_executable(bpy.app.binary_path_python)
|
||||||
|
|
||||||
|
with multiprocessing.Pool(9) as p:
|
||||||
|
results = p.map(do_cut, process_data)
|
||||||
|
for result in results:
|
||||||
|
polygons = [p for p in result if p["points"]]
|
||||||
|
self.cut_polygons.extend(polygons)
|
||||||
|
|
||||||
def get_polygon_metadata(self, polygon, position):
|
def get_polygon_metadata(self, polygon, position):
|
||||||
polygon["metadata"] = {"classes": self.get_classes(self.get_ifc_element(polygon["global_id"]), position)}
|
polygon["metadata"] = {"classes": self.get_classes(self.get_ifc_element(polygon["global_id"]), position)}
|
||||||
|
|||||||
Reference in New Issue
Block a user