11
$\begingroup$

I am testing a script in Blender game engine. I can view the helpful message on the external system console when the script throws exception. Sometimes the bugs of the script cause the Blender to crash and close the console immediately.

Is there any way to view the message after the Blender crashes? How to write the message to a text file for later viewing? Any suggestion?

$\endgroup$

3 Answers 3

13
$\begingroup$
  • On windows just run blender from Command Prompt:

    Win Key+R

    In field type cmd and hit OK. Inside the console navigate to your blender.exe with command

    cd c:\Program Files\Blender Foundation\Blender\ (or whatever your path is)
    instead you can also navigate to the folder in the Explorer and SHIFT+Rightclick on the Folder and select Open Comand Promt here

    and then type blender.exe

    You can also use command line arguments.

    Now even if Blender crashes, you will still see the program output in the console.

  • On OSX use Terminal app and run it like

    cd /Applications/Blender
    ./blender.app/Contents/MacOS/blender
    
  • On Linux open terminal and run

    cd <blender installation directory>
    ./blender
    

You can start blender (or blender.exe) with the option --factory-startup attached to check if a addon or a setting caused the crash

$\endgroup$
2
  • $\begingroup$ thanks for the suggestion, it worked cd "c:\Program Files\Blender Foundation\Blender"<br> blender<br> $\endgroup$
    – ShungChing
    Commented Jan 5, 2015 at 18:23
  • $\begingroup$ On vista and windows 7 you do not have to open the run window. You can type cmd in to the start menu and press enter. $\endgroup$
    – David
    Commented Jan 6, 2015 at 17:16
7
$\begingroup$

Start blender from a console / cmd prompt in the first place and if it crashes, it will just return to the console and not close the console.

For windows i set up a bat file to load cmd.exe, with any of these variants:

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe --debug-all

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe --debug

start C:\Windows\System32\cmd.exe /k C:\blender_trunk\blender.exe

It will load the cmd prompt, then blender, and depending on how much info you want you add the debug flag. Make a shortcut to the bat file, and all you have to do is click it to start Blender + console

$\endgroup$
4
  • $\begingroup$ thanks for the suggestion, i tried and found that the quote should be as follows: start C:\Windows\System32\cmd.exe /k "c:\Program Files\Blender Foundation\Blender\blender.exe" --debug-all<br> it was a minor typo that may confuse others who may want to try your suggestion. $\endgroup$
    – ShungChing
    Commented Jan 5, 2015 at 18:21
  • $\begingroup$ @ShungChing the quote in my post is exactly how I have it on my system, but it appears the quotes can be dropped entirely. $\endgroup$
    – zeffii
    Commented Jan 6, 2015 at 11:57
  • 1
    $\begingroup$ If there is a space in the path, it must be wrapped in quotes. $\endgroup$
    – Greg Zaal
    Commented Jan 7, 2015 at 5:22
  • $\begingroup$ yes, that's what I thought! my original path doesn't have spaces so the quotes aren't even needed, whereas @ShungChing's path is program<space>files $\endgroup$
    – zeffii
    Commented Jan 7, 2015 at 12:11
1
$\begingroup$

Go to the Menu Bar > Windows and click on Toggle System Console

$\endgroup$
1
  • 2
    $\begingroup$ Please note the Toggle System Console menu item exists only for Microsoft Windows OS builds of blender. $\endgroup$
    – batFINGER
    Commented Mar 25, 2020 at 1:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .