diff --git a/src/bonsai/bonsai/bim/module/bcf/operator.py b/src/bonsai/bonsai/bim/module/bcf/operator.py index c4a5464ebf..a33fff28b5 100644 --- a/src/bonsai/bonsai/bim/module/bcf/operator.py +++ b/src/bonsai/bonsai/bim/module/bcf/operator.py @@ -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"} diff --git a/src/bonsai/bonsai/bim/module/bcf/ui.py b/src/bonsai/bonsai/bim/module/bcf/ui.py index 0b081daba7..bf5270765f 100644 --- a/src/bonsai/bonsai/bim/module/bcf/ui.py +++ b/src/bonsai/bonsai/bim/module/bcf/ui.py @@ -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()