mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
bonsai bcf - add save current project button
Now there are two separate buttons - "save project" and "save project as". Example - https://i.imgur.com/1vuVfgi.png
This commit is contained in:
@@ -332,6 +332,7 @@ class SaveBcfProject(bpy.types.Operator):
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
|
||||
filter_glob: bpy.props.StringProperty(default="*.bcf;*.bcfzip", options={"HIDDEN"})
|
||||
save_current_bcf: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"})
|
||||
|
||||
def execute(self, context):
|
||||
bcfxml = bcfstore.BcfStore.get_bcfxml()
|
||||
@@ -341,6 +342,12 @@ class SaveBcfProject(bpy.types.Operator):
|
||||
return {"FINISHED"}
|
||||
|
||||
def invoke(self, context, event):
|
||||
if self.save_current_bcf:
|
||||
path = tool.Bcf.get_path()
|
||||
if path:
|
||||
self.filepath = str(path)
|
||||
return self.execute(context)
|
||||
|
||||
context.window_manager.fileselect_add(self)
|
||||
return {"RUNNING_MODAL"}
|
||||
|
||||
|
||||
@@ -47,7 +47,9 @@ class BIM_PT_bcf(Panel):
|
||||
return
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("bim.save_bcf_project", icon="EXPORT", text="Save Project")
|
||||
op = row.operator("bim.save_bcf_project", icon="FILE_TICK", text="Save Current Project")
|
||||
op.save_current_bcf = True
|
||||
row.operator("bim.save_bcf_project", icon="EXPORT", text="Save Project As...")
|
||||
row.operator("bim.unload_bcf_project", text="", icon="CANCEL")
|
||||
|
||||
row = layout.row()
|
||||
|
||||
Reference in New Issue
Block a user