9
$\begingroup$

Noobie here.

Should I open Mac terminal and cd to /Applications/Blender/ which is where my Blender app is? Doesn't seem to work for me trying to run script from Text screen in Blender. I guess there is no way to see output within Blender itself?

$\endgroup$
1
  • $\begingroup$ Related 1 2 $\endgroup$
    – batFINGER
    Mar 11 '18 at 7:05
10
+50
$\begingroup$

Right click on the Blender icon in the Applications folder and select "Show Package contents". Make an alias of Contents/MacOS/Blender by right clicking and selecting "Make Alias". Rename it and move it somewhere you like.

This opens the console in the background, next to the Blender application.

source: https://www.lynda.com/Blender-tutorials/Set-up-Blender-console-window/486043/533594-4.html

$\endgroup$
1
  • 2
    $\begingroup$ this is so much more straightforward than the answer above and works perfeclty, wondering why its not the selected answer? $\endgroup$
    – Nick
    Aug 21 '19 at 10:27
6
$\begingroup$

The only way to see the Blender console and thus the script output is to launch Blender from a terminal using the full path to the executable: "/Applications/Blender/blender.app/Contents/MacOS/blender"

All script output will appear in the terminal only.

Following @DickMeehan's comment and since I hate to install yet another App, here is the AppleScript to automatically start a Blender with its Terminal window.

Note: tested on MacOS High Sierra 10.13.3 only:

    set blenderAppPath to "/Applications/Blender/blender.app/Contents/MacOS/blender"

    (* This command will open a Terminal app that should be closed with CMD-Q otherwise
   it will persist after Blender and the terminal window are closed with CMD-W *)

    set openCmd to "open -n -W -a /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal --args "

    do shell script openCmd & blenderAppPath

Refer to the following to make an actual clickable App using the Automator. This app can then be simply dragged to the launch bar for convenience.

https://apple.stackexchange.com/questions/84348/how-can-i-create-a-stand-alone-app-to-run-a-terminal-command

enter image description here enter image description here

$\endgroup$
5
  • 1
    $\begingroup$ Please flesh this out a bit. I have a feeling the OP thinks that changing console directory fo app folder of blender while blender is running will "magically" display the output, as opposed to starting the application from the console. This answer was flagged as low-quality because of its length and content. $\endgroup$
    – batFINGER
    Mar 11 '18 at 11:36
  • 1
    $\begingroup$ I admit, poor connectivity so quick and dirty answer... just edited, should be better now! $\endgroup$
    – Bruno
    Mar 11 '18 at 12:37
  • $\begingroup$ Following this suggestion if I want to see output from Blender I open it from Mac terminal with this command: /Applications/Blender/blender.app/Contents/MacOS/blender . I can open Blender by clicking on the blender.app but cannot see the results in blender, I must have the terminal app loaded from the command line as above. $\endgroup$ Mar 15 '18 at 14:27
  • $\begingroup$ Thanks for the help. Just to clarify: My Blender app is in the a Blender folder within the usual Applications folder. I open Blender from the Mac terminal window by entering: /Applications/Blender/blender.app/Contents/MacOS/blender. From this point on Blender output such as print() will appear in the terminal window which should be viewed in parallel with the blender window. $\endgroup$ Mar 23 '18 at 5:05
  • $\begingroup$ Copying the path to blender and pasting into Mac terminal interrupts work flow. I found a nice free terminal emulator (one of many) called iterm that can be set up so that it opens Blender via a terminal window as above with one click. If you save your work as the default periodically via Ctrl-u and then make a coding mistake that you don't want to unravel you can just close blender and reopen via iterm you will get your most recent save with little delay. $\endgroup$ Mar 26 '18 at 5:18
2
$\begingroup$

A really quick way for mac users to do this is to create an alias using the Terminal (It's not as scary as it looks)

open Terminal

type nano ~/.bash_profile

on the first line paste this alias blender='/Applications/blender-2.80.0/blender.app/Contents/MacOS/blender'

Exit nano by ctrl + x and press y to save changes

type source ~/.bash_profile

You only need to do this once.

Now every time you need to open Blender from the command line, open terminal and type blender

Blender will launch from the terminal and you can see the output.

$\endgroup$
0
$\begingroup$

If you want to be able to launch it like any other application, the simplest way is to do this:

  1. Launch Automator (it is in your Mac's Applications folder) and launch Terminal (it is in Applications/Utilities).

  2. Create a new Application in Automator.

  1. Type "run" in the variables search field, and drag Run Shell Script to the right part of the workspace.
  1. In Finder, locate Blender.app (it is probably in your Applications folder). Right click on the app and choose Show Package Contents. Inside the Contents, navigate to /Contents/MacOS/Blender

  2. Drag this Blender file onto your Terminal window and Terminal will show you the file path. For me it is /Applications/Blender\ 2.9.app/Contents/MacOS/Blender, for example.

  3. Copy that file path. Inside Automator, in the Run Shell Script text field, type open then space, then paste in the file path. Example: open /Applications/Blender\ 2.9.app/Contents/MacOS/Blender

Launching Blender with the Terminal console, using a shell script in Automator

  • Note: If you have multiple versions of Blender in your Applications folder (Blender 2.79b.app, Blender 2.9.app, Blender 2.92.app ...) and update regularly (as you should), then it might make more sense to create an alias in your Applications folder of .../Contents/MacOS/Blender called something like "Blender - Console" and use that for your shell script path instead: open /Applications/Blender\ -\ Console. Then you don't need to mess with Automator each time you get a new version of Blender - simply make a new alias with the name "Blender - Console". This way launching "Blender (Console).app" (or whatever you name it) will always point to the latest.
  1. Name and save your launcher app in your Applications folder. Then in Finder you can drag it to your Dock.

8 (Optional). If you don't like the default robot icon, you can give your app a custom icon using Finder's Info window. In your Applications folder, select both Blender.app and your new custom app, then press CmdI to Get Info. Click on Blender.app's icon to highlight it, then CmdC to copy it. Then click to highlight your app's icon and press CmdV to paste the blender icon in.

You can create a custom icon too if you like, open it in Preview and copy it. But icon design is beyond the scope of this topic. Enjoy your custom launcher app.


Edit: One final thing to mention is that the first time you launch a newly installed version of Blender you should launch the Blender app normally instead of through your custom launcher. This gives macOS a chance to verify it so that you don't run into any errors when launching. In other words, let your Mac do this once:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.