Writing to simpleRenderable vertexData.

saladin

14-06-2007 01:40:24

Hi,

I'm trying to port the Line3D code snippet to python-ogre. And I noticed now that simpleRenderable objects don't have a member 'renderOperation' as such. So I tried creating a render operation first and then use SimpleRenderable.setRenderOperation(), not knowing if this is the right way.

But when I tried to set the vertexData with renderOp.vertexData = ogre.VertexData() of that render operation I got an 'AttributeError: can't set attribute'.

Some help will be appreciated.

Thanks.

andy

14-06-2007 06:51:56

Have a look at Demo_Grass.py as there is a workaround to this problem
## AJM: NOTE the Python-Ogre work around here
## subMesh.vertexData isn't being exposed as a writeable property due to boost limitation
## hence a new function has been added.
## C++ Code: sm->vertexData = new VertexData();
sm.createVertexData() # wrapper to create VertexData and assign it to .VertexData

Cheers
Andy

saladin

17-06-2007 23:25:53

Have a look at Demo_Grass.py as there is a workaround to this problem
## AJM: NOTE the Python-Ogre work around here
## subMesh.vertexData isn't being exposed as a writeable property due to boost limitation
## hence a new function has been added.
## C++ Code: sm->vertexData = new VertexData();
sm.createVertexData() # wrapper to create VertexData and assign it to .VertexData

Cheers
Andy


Yeah it's a neat work around.
I think the manualObject class is more like the recommended way to do drawLine and stuff. So the following questions are mainly for curiosity.

1. ## subMesh.vertexData isn't being exposed as a writeable property due to boost limitation
This probably means we'd need a createVertexData() wrapper for not only the submesh class but RenderOperations and other Renderables, right?

2. how do I then set the the renderOperation for the SimpleRenderable I created?- since SimpleRenderable.renderOperation is not exposed either. Do we need a wrapper too?

andy

19-06-2007 05:33:13

I'm not sure -- have to take a look but you are probalby right on the vertexData in the other classes (probably time for me to relook at it)..

However I see that get/setRenderOperation are in SimpleRender..

Cheers
Andy