operator to quickly restart blender

This commit is contained in:
Andrej730
2024-07-23 17:24:03 +05:00
parent dda010b130
commit 9713cc0c2e
3 changed files with 16 additions and 0 deletions
@@ -36,6 +36,7 @@ classes = (
operator.ProfileImportIFC,
operator.PurgeHdf5Cache,
operator.PurgeUnusedElementsByClass,
operator.RestartBlender,
operator.RewindInspector,
operator.SelectExpressFile,
operator.SelectHighPolygonMeshes,
@@ -770,3 +770,15 @@ class ToggleDetailedIOSLogs(bpy.types.Operator):
wrapper.turn_off_detailed_logging()
self.report({"INFO"}, "Detailed IfcOpenShell logs turned off.")
return {"FINISHED"}
class RestartBlender(bpy.types.Operator):
bl_idname = "bim.restart_blender"
bl_label = "Restart Blender"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
import os
path = bpy.app.binary_path
os.execv(path, sys.argv)
@@ -78,6 +78,9 @@ class BIM_PT_debug(Panel):
row = layout.row()
row.operator("bim.toggle_detailed_ios_logs")
row = layout.row()
row.operator("bim.restart_blender")
row = layout.split(factor=0.5, align=True)
row.operator("bim.create_shape_from_step_id").should_include_curves = False
row.operator("bim.create_shape_from_step_id", text="", icon="IPO_ELASTIC").should_include_curves = True