Skip to content
Run IPython in the context of Blender's embedded Python interpreter.
Python
Branch: master
Clone or download
panzi Merge pull request #2 from wassname/patch-2
Added alt import for ipython4
Latest commit baeb1c6 Mar 19, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore more generic blender_ipython.py Nov 21, 2014
README.md Instruction for installing new kernel Mar 19, 2016
blender_ipython.py got __file__ removed from Python 3.4? Dec 4, 2014
blender_ipython_wrapper.py Added alt import for ipython4 Mar 19, 2016

README.md

IPython for Blender

These scripts contain hacks in order to run IPython in the context of Blender's embedded Python interpreter.

Usage

Start an IPython Notebook:

./blender_ipython.py notebook

Start a Qt Console:

./blender_ipython.py qtconsole

Installing Jupyter/Ipython Kernel

  • Find the jupyter kernel path for your system and create a blender directory. On unix this is ~/.local/share/jupyter/kernels

  • Place a kernel.json file in the directory ~/.local/share/jupyter/kernels/blender/kernel.json

  • The contents of the json are as follows, where you replace "PATH_TO_SCRIPT" with the actual path

{
 "argv": ["PATH_TO_SCRIPT/blender_ipython.py", "kernel",
          "-f", "{connection_file}"],
 "display_name": "Blender env",
 "language": "python"
}
  • now start the notebook normally (jupyter notebook) and you will see a new kernel under "new" called blender.
  • make a new notebook using this kernel and test it by running import bpy
  • you are now set up

Dependencies

  • Python 3.3 (not tested with Python 3.4)
  • IPython 0.13 for Python 3 (not tested with IPython 1.x)
  • Blender

I only have Python 3.3 and IPython 0.13 and thus this was not tested with any newer versions. Because this scripts use big hacks to get the IPython kernel running in Blender it is very likely that it won't work with any other versions. In fact I got bug reports where people with Python 3.4 and IPython 1.x could not get it to work.

The MIT License (MIT)

Copyright (c) 2014 Mathias Panzenböck

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.