0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

macOSのBlenderでシステムコンソールを出す方法

Last updated at Posted at 2023-08-27

背景

Windowsであれば、Blenderのウィンドウメニューのシステムコンソール切替えでBlenderのコンソール画面を出せますが、macOSのBlenderにはこのメニューがありません。

macOSでは、先にターミナル画面を開いておいて次のようにコマンドを実行すると、そのターミナル画面がコンソール画面の代わりになります。

/Applications/Blender.app/Contents/MacOS/Blender

やりたいこと

  • macOSでターミナル画面が開くBlenderアプリケーション(以降ではBlenderConsole.app)の作成

アプリケーションの構成

背景で説明したコマンドをアプリケーションにするには、下記の構成でファイルを作成します(括弧内は内容です)。BlenderConsoleがアプリケーション名です。

  • BlenderConsole.app
    • Contents
      • Info.plist(設定ファイル)
      • MacOS
        • blender.sh(コマンドのスクリプト)
      • Resources
        • blender icon.icns(アイコン)

BlenderConsole.appは、どこに置いてもよいですが、今回は、/Applicationsに置きます。

BlenderConsole.appの作成

Blender本体がインストールされている状態で、管理者権限のあるユーザのシェルで次を実行してください。

mkdir -p /Applications/BlenderConsole.app/Contents/{MacOS,Resources}
cp /Applications/Blender.app/Contents/Resources/blender_icon.icns \
   /Applications/BlenderConsole.app/Contents/Resources/

cat << EOF >> /Applications/BlenderConsole.app/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleExecutable</key>
    <string>blender.sh</string>
    <key>CFBundleIconFile</key>
    <string>blender_icon</string>
</dict>
</plist>
EOF

cat << EOF >> /Applications/BlenderConsole.app/Contents/MacOS/blender.sh
#!/bin/bash
open /Applications/Blender.app/Contents/MacOS/Blender
EOF

chmod +x /Applications/BlenderConsole.app/Contents/MacOS/blender.sh

アプリケーションフォルダのBlenderConsoleでターミナル画面が開くBlenderを実行できます。

※ 実行は自己責任でお願いします。

ターミナル画面を自動で消すための設定

BlenderConsoleを実行すると、ターミナル画面と一緒にBlenderが起動します。しかし、Blender終了時にターミナル画面が残ってしまいます。手動で消してもよいですが、次のようにすると自動で消えるようになります。

  • ターミナルを起動している状態で、ターミナルメニューの設定(⌘+,)で設定画面を開く
  • プロファイルタブのシェルの終了時シェルが正常に終了した場合は閉じるにする

Dockに追加

アプリケーションフォルダのBlenderConsoleをDockにドラッグしてください。

BlenderConsole.appの内容の確認

アプリケーションフォルダのBlenderConsoleを右クリックしてパッケージの内容を表示を選んでください。

BlenderConsole.appの削除

アプリケーションフォルダのBlenderConsoleを削除してください。

以上

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?