Re: [osg-users] osgswig: iterating over a vertex array

2009-02-26 Thread R Fritz
Thanks for the response. I'll try tackling it with ctypes, then. Not an elegant solution, but I think I can get it to work. Randolph On Feb 25, 2009, at 11:35 PM, Gerwin de Haan wrote: Hi Randolph, this is a typical problem of (python) wrappers; the getVertexArray returns a general

Re: [osg-users] osgswig: iterating over a vertex array

2009-02-26 Thread Randolph Fritz
The following code appears to work: def apply_Geode(self,ge): for i in range(ge.getNumDrawables()): geom = ge.getDrawable(i).asGeometry() if geom: arr = geom.getVertexArray() if arr.getType() != osg.Array.Vec3ArrayType:

Re: [osg-users] osgswig: iterating over a vertex array

2009-02-25 Thread Gerwin de Haan
Hi Randolph, this is a typical problem of (python) wrappers; the getVertexArray returns a general Array, which is currently not wrapped. The trick would be to somewhere cast the general Array back to its specific type in Python, e.g. a Vec3Array. We've used some of these tricks in the wrappings