Extension for Python – a dynamic library. All MoBu’s functionality performed as an extension using boost.python and connects calling “from pyfbsdk import *”

For extending python there is very usefull library python.boost

MotionBuilder 2010 uses python 2.6.1
The sequence of actions as follows:
  1. install python 2.6.1
  2. build boost.python library and preferably dll. The resulting library will be dependent on the version of your compiler and profile (debug, release), so it must be copied to the root directory of Mobu, to where there is an executable file.
  3. From boost python examples I took a file to start getting_started1.cpp
  4. I started a new project win32 dynamic library, to compile include paths to python and boost.
  5. in resulted library you need to change the extension to *. pyd and copy to the folder MotionBuilder 2010 \ bin \ win32 \ python \ lib \ plat-win \ DLLs \
  6. My library, I called python_ext, while changing the identifier in the call BOOST_PYTHON_MODULE before compilation. And running Mobu successfully perform a test function call in python:
from python_ext import *
print greet ()
Extending python for MoBu 2010
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *