diff --git a/src/bonsai/bonsai/bim/operator.py b/src/bonsai/bonsai/bim/operator.py index ef0ae2dd64..ff1d2ec605 100644 --- a/src/bonsai/bonsai/bim/operator.py +++ b/src/bonsai/bonsai/bim/operator.py @@ -310,15 +310,15 @@ class FileAssociate(bpy.types.Operator): os.makedirs(os.path.join(destdir, rel_path), exist_ok=True) shutil.copy( - os.path.join(src_dir, "blenderbim.png"), + os.path.join(src_dir, "bonsai.png"), os.path.join(destdir, "share/icons/hicolor/128x128/apps"), ) shutil.copy( - os.path.join(src_dir, "blenderbim.desktop"), + os.path.join(src_dir, "bonsai.desktop"), os.path.join(destdir, "share/applications"), ) shutil.copy( - os.path.join(src_dir, "blenderbim.xml"), + os.path.join(src_dir, "bonsai.xml"), os.path.join(destdir, "share/mime/packages"), ) shutil.copyfile( @@ -327,13 +327,13 @@ class FileAssociate(bpy.types.Operator): ) # copy and rewrite wrapper script - with open(os.path.join(src_dir, "blenderbim"), "r") as wrapper_template: + with open(os.path.join(src_dir, "bonsai"), "r") as wrapper_template: filedata = wrapper_template.read() filedata = filedata.replace("#BLENDER_EXE=/opt/blender-3.3/blender", 'BLENDER_EXE="' + binary_path + '"') - with open(os.path.join(destdir, "bin", "blenderbim"), "w") as wrapper: + with open(os.path.join(destdir, "bin", "bonsai"), "w") as wrapper: wrapper.write(filedata) - os.chmod(os.path.join(destdir, "bin", "blenderbim"), 0o755) + os.chmod(os.path.join(destdir, "bin", "bonsai"), 0o755) self.refresh_system_linux(destdir=destdir) @@ -383,11 +383,11 @@ class FileUnassociate(bpy.types.Operator): def uninstall_desktop_linux(self, destdir="/tmp"): """Removes linux file assocations and launcher icon""" for rel_path in ( - "share/icons/hicolor/128x128/apps/blenderbim.png", + "share/icons/hicolor/128x128/apps/bonsai.png", "share/icons/hicolor/128x128/mimetypes/x-ifc.png", - "share/applications/blenderbim.desktop", - "share/mime/packages/blenderbim.xml", - "bin/blenderbim", + "share/applications/bonsai.desktop", + "share/mime/packages/bonsai.xml", + "bin/bonsai", ): try: os.remove(os.path.join(destdir, rel_path)) diff --git a/src/bonsai/bonsai/libs/desktop/Makefile b/src/bonsai/bonsai/libs/desktop/Makefile index e17077fae7..c77eec7215 100644 --- a/src/bonsai/bonsai/libs/desktop/Makefile +++ b/src/bonsai/bonsai/libs/desktop/Makefile @@ -9,21 +9,21 @@ install : ${DESTDIR}/share/icons/hicolor/128x128/mimetypes \ ${DESTDIR}/share/applications \ ${DESTDIR}/share/mime/packages - cp blenderbim ${DESTDIR}/bin/ - chmod +x ${DESTDIR}/bin/blenderbim - cp blenderbim.png ${DESTDIR}/share/icons/hicolor/128x128/apps/ - cp blenderbim.desktop ${DESTDIR}/share/applications/ - cp blenderbim.xml ${DESTDIR}/share/mime/packages/ + cp bonsai ${DESTDIR}/bin/ + chmod +x ${DESTDIR}/bin/bonsai + cp bonsai.png ${DESTDIR}/share/icons/hicolor/128x128/apps/ + cp bonsai.desktop ${DESTDIR}/share/applications/ + cp bonsai.xml ${DESTDIR}/share/mime/packages/ cp x-ifc_128x128.png ${DESTDIR}/share/icons/hicolor/128x128/mimetypes/x-ifc.png update-mime-database ${DESTDIR}/share/mime/ || true update-desktop-database ${DESTDIR}/share/applications/ || true uninstall : rm -f \ - ${DESTDIR}/bin/blenderbim \ - ${DESTDIR}/share/icons/hicolor/128x128/apps/blenderbim.png \ - ${DESTDIR}/share/applications/blenderbim.desktop \ - ${DESTDIR}/share/mime/packages/blenderbim.xml \ + ${DESTDIR}/bin/bonsai \ + ${DESTDIR}/share/icons/hicolor/128x128/apps/bonsai.png \ + ${DESTDIR}/share/applications/bonsai.desktop \ + ${DESTDIR}/share/mime/packages/bonsai.xml \ ${DESTDIR}/share/icons/hicolor/128x128/mimetypes/x-ifc.png update-mime-database ${DESTDIR}/share/mime/ || true update-desktop-database ${DESTDIR}/share/applications/ || true diff --git a/src/bonsai/bonsai/libs/desktop/README.md b/src/bonsai/bonsai/libs/desktop/README.md index a3567de060..b77cfffa6d 100644 --- a/src/bonsai/bonsai/libs/desktop/README.md +++ b/src/bonsai/bonsai/libs/desktop/README.md @@ -2,20 +2,20 @@ Desktop ======= This folder contains everything needed to create file associations and icons to -present BlenderBIM as a desktop application. +present Bonsai as a desktop application. Linux ----- -Assuming that blender and BlenderBIM are already installed on your system, +Assuming that blender and Bonsai are already installed on your system, configure associations and icons for a single user by running `make`: make install -Test by running the wrapper script directly, this should launch BlenderBIM with +Test by running the wrapper script directly, this should launch Bonsai with an empty IFC project: - blenderbim + bonsai This `Makefile` installs files to `~/.local` by default, to install to an alternative location, set `DESTDIR`: diff --git a/src/bonsai/bonsai/libs/desktop/blenderbim b/src/bonsai/bonsai/libs/desktop/blenderbim deleted file mode 100755 index 1de7b9a710..0000000000 --- a/src/bonsai/bonsai/libs/desktop/blenderbim +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Wrapper script to launch BlenderBIM. - -# If the `blender` executable can't be found in your PATH environment, set -# BLENDER_EXE to the location of your preferred `blender` executable. - -#BLENDER_EXE=/opt/blender-3.3/blender - -: ${BLENDER_EXE:=blender} - -if [[ $# -eq 1 && -f "$@" ]]; then - "${BLENDER_EXE}" --python-expr 'import bpy; bpy.data.batch_remove(bpy.data.objects); bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=True); bpy.ops.bim.load_project(filepath="'"$@"'")' -else - "${BLENDER_EXE}" --python-expr 'import bpy; bpy.data.batch_remove(bpy.data.objects); bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=True); bpy.ops.bim.create_project()' -fi; diff --git a/src/bonsai/bonsai/libs/desktop/blenderbim.desktop b/src/bonsai/bonsai/libs/desktop/blenderbim.desktop deleted file mode 100644 index 29919736d1..0000000000 --- a/src/bonsai/bonsai/libs/desktop/blenderbim.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Terminal=false -Exec=blenderbim %f -Name=BlenderBIM -Icon=blenderbim -X-Desktop-File-Install-Version=0.26 -GenericName=Blender BIM add-on -MimeType=application/x-ifc; diff --git a/src/bonsai/bonsai/libs/desktop/blenderbim.png b/src/bonsai/bonsai/libs/desktop/blenderbim.png deleted file mode 100644 index 3df402d817..0000000000 Binary files a/src/bonsai/bonsai/libs/desktop/blenderbim.png and /dev/null differ diff --git a/src/bonsai/bonsai/libs/desktop/blenderbim.xml b/src/bonsai/bonsai/libs/desktop/blenderbim.xml deleted file mode 100644 index fa9b6c2782..0000000000 --- a/src/bonsai/bonsai/libs/desktop/blenderbim.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Industry Foundation Classes - - - - - - - - - diff --git a/src/bonsai/bonsai/libs/desktop/windows_bbim_association.ps1 b/src/bonsai/bonsai/libs/desktop/windows_bbim_association.ps1 index 11926a170a..c89dccbd62 100644 --- a/src/bonsai/bonsai/libs/desktop/windows_bbim_association.ps1 +++ b/src/bonsai/bonsai/libs/desktop/windows_bbim_association.ps1 @@ -6,11 +6,11 @@ Start-Process cmd -ArgumentList ` "/k ", ` "ASSOC .IFC=", ` "&", ` - "FTYPE BLENDERBIM=""$BlenderPath"" --python-expr ""import bpy; bpy.ops.bim.load_project(filepath=r'%1')""", + "FTYPE BONSAI=""$BlenderPath"" --python-expr ""import bpy; bpy.ops.bim.load_project(filepath=r'%1')""", "&", ` - "echo. & echo. & echo To create an association between .IFC files and BlenderBIM", ` + "echo. & echo. & echo To create an association between .IFC files and Bonsai", ` "&", ` "echo type the command below & echo.", ` "&", ` - "echo ASSOC .IFC=BLENDERBIM & echo." ` --Verb RunAs \ No newline at end of file + "echo ASSOC .IFC=BONSAI & echo." ` +-Verb RunAs