Python-Ogre Blender Support


14-02-2011 07:08:05

Some time back I looked at loading blender files directly to python-ogre based on the awesome work carried out by the OgreKit developers, but never quite got it working.

I've had another look and managed to load a blender file in python, albeit via OgreKit e.g:

import sys
import PythonOgreConfig

import ogre.renderer.OGRE as ogre
##from sf_OIS import *
import SampleFramework as sf
import ogre.addons.ogreblender as ogreblender

if __name__ == '__main__':
gkEngine = ogreblender.gkEngine()

f = ogreblender.gkBlendLoader.getSingleton().loadFile('buggy.blend')

it = f.getSceneIterator()
while it.hasMoreElements():
scene = it.getNext()
print dir(scene)



What started as addon to python-ogre ended with a fair bit of OgreKit being wrapped ( the .so file is about 60MB). The above is based on OgreKit source many months ago and will need updated/simplified.

Is anyone else working on something similar? Alternatively should we wait until python-ogre supports Python 3 and directly export from Blender 2.5.X, thoughts anyone?