3
$\begingroup$

I would like to have a python notebook running on my localhost:8000 that i can execute bpy scripts with... and see the resulting change in my other monitor which is running blender.

Normally, I would have to import a script into the "Scripting - TextEditor" view and hit "run script". Is there a way to bypass this interface?

$\endgroup$
1
4
$\begingroup$

One of the most important things to be aware of is installing the correct version of the tools:

Using the current 2.91 Blender version we should use Python 3.7. We can install that using Anaconda3 2020.02 from exe, list of packages.

After that we need to install the blender kernel from here, using the following command in anaconda terminal:

python -m pip install blender_notebook
blender_notebook install --blender-exec="C:\Program Files\Blender Foundation\Blender 2.91\blender.exe"

Now, when we start Jupyter Notebook we can select blender kernel.

First, you need to import the Blender specific library bpy:

# blender related imports
import bpy

After that, we are able to use many examples, already available out there.

I've made an example Jupyter Notebook on this topic, available here

See the discussion and plans on updating blender's python version here.

Update:

Blender 2.93: Python was upgraded to version 3.9.1. link

$\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.