Utilize Blender 2.8 to instantly open all kinds of 3D model files by double clicking them from Cinnamon / Nemo or similar. Bash, Python and some configuration for Linux Mint 19.3
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

blender-launcher.sh 385B

12345678910111213
  1. #!/bin/bash
  2. if [[ -f $1 ]]; then
  3. echo "$1 is a file"
  4. filename=$(basename -- "$1")
  5. extension="${filename##*.}"
  6. if [[ $extension == *"blend"* ]]; then
  7. exec ~/.local/share/blender/blender "$@"
  8. else
  9. exec ~/.local/share/blender/blender --python ~/.local/bin/blender_2.8_import_3dobjects.py -- "$1"
  10. fi
  11. else
  12. exec ~/.local/share/blender/blender "$@"
  13. fi