Add to recent projects when project is saved

This commit is contained in:
Andrej730
2024-09-16 11:02:31 +05:00
parent 0891df5d6c
commit cfd63392e7
2 changed files with 3 additions and 0 deletions
@@ -1320,6 +1320,8 @@ class ExportIFCBase:
ifc_exporter.export()
settings.logger.info("Export finished in {:.2f} seconds".format(time.time() - start))
print("Export finished in {:.2f} seconds".format(time.time() - start))
# New project created in Bonsai should be in recent projects too.
tool.Project.add_recent_ifc_project(Path(output_file))
scene = context.scene
if not scene.DocProperties.ifc_files:
new = scene.DocProperties.ifc_files.add()
+1
View File
@@ -194,6 +194,7 @@ class Project(bonsai.core.tool.Project):
If `filepath` was opened before, bump it in the list.
"""
filepath = filepath.absolute()
current_filepaths = cls.get_recent_ifc_projects()
if filepath in current_filepaths:
current_filepaths.remove(filepath)