Rename blenderbim.sh, better initialisation #2399

This commit is contained in:
Bruno Postle
2023-05-07 09:46:15 +01:00
parent b8431a8c33
commit b987d5ca7c
5 changed files with 21 additions and 21 deletions
+3 -3
View File
@@ -9,8 +9,8 @@ install :
${DESTDIR}/share/icons/hicolor/128x128/mimetypes \
${DESTDIR}/share/applications \
${DESTDIR}/share/mime/packages
cp blenderbim.sh ${DESTDIR}/bin/
chmod +x ${DESTDIR}/bin/blenderbim.sh
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/
@@ -20,7 +20,7 @@ install :
uninstall :
rm -f \
${DESTDIR}/bin/blenderbim.sh \
${DESTDIR}/bin/blenderbim \
${DESTDIR}/share/icons/hicolor/128x128/apps/blenderbim.png \
${DESTDIR}/share/applications/blenderbim.desktop \
${DESTDIR}/share/mime/packages/blenderbim.xml \
+1 -1
View File
@@ -15,7 +15,7 @@ configure associations and icons for a single user by running `make`:
Test by running the wrapper script directly, this should launch BlenderBIM with
an empty IFC project:
blenderbim.sh
blenderbim
This `Makefile` installs files to `~/.local` by default, to install to an
alternative location, set `DESTDIR`:
+16
View File
@@ -0,0 +1,16 @@
#!/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;
+1 -1
View File
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Terminal=false
Exec=blenderbim.sh %f
Exec=blenderbim %f
Name=BlenderBIM
Icon=blenderbim
X-Desktop-File-Install-Version=0.26
-16
View File
@@ -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.collections.remove(bpy.data.collections[0]); bpy.ops.bim.load_project(filepath="'"$@"'")'
else
"${BLENDER_EXE}" --python-expr 'import bpy; bpy.data.collections.remove(bpy.data.collections[0]); bpy.ops.bim.create_project()'
fi;