-
-
Notifications
You must be signed in to change notification settings - Fork 28
Home
Tyler Alden Gubala edited this page Jun 12, 2020
·
9 revisions
Welcome to the blenderpy wiki!
This repository installs a python module of blender after running
pip install bpy
A supported python installation with pip installed
pip install bpy
THIS WILL NOT BE AVAILABLE UNTIL PYPA INCREASES THE UPLOAD LIMIT
Please for the time being either install wheels on Google Drive or build from sources.
ALL users should have the prerequisites listed on Blender's Wiki page for building Blender on their operating system. Please see this page before performing any kind of build on Blender!
- Windows users must have Visual Studio 2013 or later and C++ build tools installed to build from sources
- ALL users must have
cmake
3.13.5 or higher - ALL users must have
git
installed - ALL users must have an SVN command-line provider to build from sources (this is a requirement as it is how we determine the correct release tag to grab, if any)
- The recommended
svn
for Windows is TortoiseSVN
- The recommended
- ALL users must have
future-fstrings
installedpip install -U future-fstrings
- Users of Python versions 3.4 and below will probably need to update
setuptools
pip install -U setuptools
- Up-to-date
wheel
(if distributing)
py -m pip install bpy --no-binary
- Create overriding classes CMakeExtension & BuildCMake, which inheirit from the setuptools classes
- bpy is a python extension (.pyd) and an instance of CMakeExtension
- BuildCMake is the command that is run when installing the extension from pip (or running setup.py)
- Find the best Blender version for this OS, Python version and bitness using
bpy-build
automation - Using GitPython, clone Blender sources from https://git.blender.org/
- Download the appropriate svn library
- Using
cmake
, configure Blender as a python module- https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule
- configure this build solution in the build_temp directory of the bpy package
- Using
cmake
, build the configured solution - Place the built binaries in the built extension parent directory (important!)
- Relocate the / directory (i.e: /2.79) into the directory containing the executable from which this installation was spawned (where 'python.exe' is)
- Clean up using the remaining functionality from the superclasses
build_ext
andExtension
- bpy.pyd/ .so should now be installed into the site-packages
Blender has special requirements on where to find the Blender scripts. Therefore an additional command needs to be run after installation.
bpy_post_install