Blender System Console in VS Code Terminal?

Is it possible to display the System Console of Blender in a Terminal in VS Code?

1 Like

You can pretty easily redirect the sys.stdout to go into a different terminal, so with some fiddling around you should be able to get it into VS Code:

1 Like

I recommend running Blender as a task via vscode. This makes it handle the standard io automatically so signal handling for Ctrl-C / Ctrl-Break works.

4 Likes

I’d go a step further and just say- download the vscode extension by jacques lucke since it does all of that automatically and handles things like symlinks, code templates, etc.

4 Likes

Hey, cool… many answers and the best is, it obviously possible :slight_smile:

I will check all this out and will report what happend…

Thank you!

Yay it worked.
I used the Task way because the Blender Development addon isn’t being developed anymore and the version I installed doesn’t seem to automatically do what I want. And I haven’t found a How To for the Addon.

So I created a Task in VS Code and installed the Script Runner Addon.

First, this wasn’t working. However, after escaping the path to Blender correctly now everything works fine and Blender console output is appearing in VS Code Terminal… Great!

Reminder:
Don’t foget to escape your path correctly.

For example:
This was my first attempt, not working

(Inside the task.json)

"command": "C:\\Programme\\Blender Foundation\\Blender 3.2\\blender.exe"

So don’t forget to put the folders with spaces in their names in single quotes
like this ‘Blender Foundation’

"command": "C:\\Programme\\'Blender Foundation'\\'Blender 3.2'\\blender.exe"

And concludingly, this is my task.json file:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Start Blender",
            "type": "shell",
            "command": "C:\\Programme\\'Blender Foundation'\\'Blender 3.2'\\blender.exe"
        }
    ]
}
1 Like