Problem setting "shadowbuffer" with meshManager.load


15-02-2009 22:16:06

Hi. For the last few days I've been trying to get opcode working in Python-Ogre (the included version). From what I can tell, I need to load a mesh using a "shadowbuffer" in system memory so that I can access the buffer and feed opcode the geometry data that it needs. I'm using an arbitrary mesh loaded from a .mesh file as my level geometry. I've tried several approaches, but I haven't had any luck so far in turning on the "shadowbuffer" setting for a mesh loaded from disk. Here's a short code snippet that Illustrates the problem that I'm having:

meshManager = ogre.MeshManager.getSingleton()
me = meshManager.load("Plane.mesh", "General", ogre.HardwareBuffer.Usage.HBU_STATIC, ogre.HardwareBuffer.Usage.HBU_STATIC, True, True)
pSubMesh = me.getSubMesh(0)
elem = pSubMesh.vertexData.vertexDeclaration.findElementBySemantic(ogre.VES_POSITION)
vbuf = pSubMesh.vertexData.vertexBufferBinding.getBuffer(elem.getSource())
print "vbuf.isSystemMemory()=", vbuf.isSystemMemory()
print "vbuf.hasShadowBuffer()=", vbuf.hasShadowBuffer()

When I run the program, I get this in the console:

vbuf.isSystemMemory()= False
vbuf.hasShadowBuffer()= False

It seems that the last two parameters of the meshManager.load method aren't having the desired effects. Also, If anyone has any alternate suggestions or code for creating an entity from a loaded mesh while controlling the "shadowBuffer" setting and hardware buffer usage, I'd love to see it :-)

Thanks in advance,
Joe Greenawalt