Developers / Connecting Blender 2.5 to DrQueue

Motivation

Problems

  • Blender 2.5 uses Python 3.1 which is incompatible to Python 2.x code
  • easy way of installation is required for users

Assumptions

  • The following package installation methods apply to Macports on Mac OSX.

Making DrQueue Python bindings compatible with Python 3

  • install Python 3.1
    sudo port install python31
    
  • install new version of Setuptools for Python 3 (see http://pypi.python.org/pypi/distribute)
    curl -O http://python-distribute.org/distribute_setup.py
    python3.1 distribute_setup.py
    
  • SWIG with support for Python 3 (use swig version > 1.3)
    sudo port install swig swig-python
    
  • fix python directory in DrQueue sources
    cd ~drqueue-git-clone/python
    rm ez_setup.py*
    patch -p1 < python_3.1_bindings.patch
    

Install Blender 2.5 beta

  • taken in short from http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Mac
  • checkout Blender sources
    cd ~
    mkdir blender-svn
    cd blender-svn
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/blender
    
  • checkout dependencies
    mkdir lib
    cd lib
    svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/darwin-9.x.universal
    
  • configure Blender
    cd ~/blender-svn/blender
    cp config/darwin-config.py user-config.py
    
  • edit user-config.py
    ...
    MACOSX_ARCHITECTURE = 'x86_64'
    ...
    WITH_BF_GAMEENGINE=False
    ...
    
  • build Blender
    python scons/scons.py -j 2
    

Build Blender 2.5 extension

  • see ~/blender-svn/build/darwin/bin/blender.app/Contents/MacOS/.blender/scripts/io/engine_render_pov.py as an example
  • basic functionality:
    • create job through render controls
    • give feedback about job status (poll job status on master)
  • properties to recycle:
    • render mode (image or animation)
    • dimensions (output resolution, number of frames, start frame, stop frame)
    • extra options (anti-aliasing, layers, motion blur, shading)
  • new properties:
    • job name
    • status indicator
    • start/stop button

Install DrQueue Blender 2.5 extension

  • build and install new Python 3 bindings
    cd ~drqueue-git-clone/python
    python3.1 setup.py build
    sudo python3.1 setup.py install
    
  • install DrQueue bindings module into Blender's Python instance
    cp -rv /opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/\
    site-packages/drqueue-0.64.3-py3.1-macosx-10.6-universal.egg/drqueue ~/blender-svn/\
    build/darwin/bin/blender.app/Contents/MacOS/.blender/python/lib/python3.1/site-packages/
    
  • install DrQueue Blender plugin (yet to be written)
    cp ~drqueue-git-clone/contrib/Blender/engine_render_drqueue.py ~/blender-svn/\
    build/darwin/bin/blender.app/Contents/MacOS/.blender/scripts/io/
    

python_3.1_bindings.patch Magnifier - python_3.1_bindings.patch (1 KB) Andreas Schröder, 04/06/2010 12:30 am