mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
black .
This commit is contained in:
@@ -260,7 +260,6 @@ class SaveBlendMetadataFile(bpy.types.Operator):
|
|||||||
self.report({"WARNING"}, "No IFC file path set.")
|
self.report({"WARNING"}, "No IFC file path set.")
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
|
||||||
blendmetadata_path = ifc_file + ".metadata.blend"
|
blendmetadata_path = ifc_file + ".metadata.blend"
|
||||||
|
|
||||||
ifc_dir = os.path.dirname(ifc_file)
|
ifc_dir = os.path.dirname(ifc_file)
|
||||||
@@ -332,12 +331,14 @@ except Exception:
|
|||||||
bpy.ops.wm.save_as_mainfile(filepath=r'{blendmetadata_path}')
|
bpy.ops.wm.save_as_mainfile(filepath=r'{blendmetadata_path}')
|
||||||
"""
|
"""
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile("w", suffix=".py", delete=False) as script_file:
|
with tempfile.NamedTemporaryFile("w", suffix=".py", delete=False) as script_file:
|
||||||
script_file.write(cleanup_script)
|
script_file.write(cleanup_script)
|
||||||
script_path = script_file.name
|
script_path = script_file.name
|
||||||
|
|
||||||
blender_exe = bpy.app.binary_path
|
blender_exe = bpy.app.binary_path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[blender_exe, temp_path, "--background", "--python", script_path], capture_output=True, text=True
|
[blender_exe, temp_path, "--background", "--python", script_path], capture_output=True, text=True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user