dermont
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.
http://code.google.com/p/gamekit/wiki/OgreKit
I've had another look and managed to load a blender file in python, albeit via OgreKit e.g:
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?
http://code.google.com/p/gamekit/wiki/OgreKit
I've had another look and managed to load a blender file in python, albeit via OgreKit e.g:
import sys
sys.path.insert(0,'..')
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()
gkEngine.initialize()
f = ogreblender.gkBlendLoader.getSingleton().loadFile('buggy.blend')
it = f.getSceneIterator()
while it.hasMoreElements():
scene = it.getNext()
print dir(scene)
scene.load()
gkEngine.loadResources("resources.cfg")
gkEngine.setActiveScene(scene)
gkEngine.run()
gkEngine.finalize()
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?