mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
Reuse ImportHelper/ExportHelper everywhere possible for consistency
This commit is contained in:
@@ -32,6 +32,7 @@ import importlib
|
||||
import logging
|
||||
import types
|
||||
import bpy
|
||||
from bpy_extras.io_utils import ExportHelper
|
||||
|
||||
logger = logging.getLogger("sverchok.ifc")
|
||||
|
||||
@@ -180,15 +181,15 @@ class IFC_Sv_UpdateCurrent(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
class IFC_Sv_write_file(bpy.types.Operator):
|
||||
class IFC_Sv_write_file(bpy.types.Operator, ExportHelper):
|
||||
bl_idname = "ifc.write_file_panel"
|
||||
bl_label = "Write File"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
bl_description = "Save transient IFC file to the provided path."
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
filter_glob: bpy.props.StringProperty(default="*.ifc", options={"HIDDEN"})
|
||||
node_group: bpy.props.StringProperty(default="")
|
||||
force_mode: bpy.props.BoolProperty(default=False)
|
||||
filename_ext = ".ifc"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@@ -264,10 +265,6 @@ class IFC_Sv_write_file(bpy.types.Operator):
|
||||
self.report({"INFO"}, f"File written to: {self.filepath}")
|
||||
return {"FINISHED"}
|
||||
|
||||
def invoke(self, context, event):
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {"RUNNING_MODAL"}
|
||||
|
||||
|
||||
class IFC_PT_write_file_panel(bpy.types.Panel):
|
||||
bl_idname = "IFC_PT_write_file_panel"
|
||||
|
||||
Reference in New Issue
Block a user