Using GeomVertexRewriter[SOLVED]

I decided I wanted to randomize the vertexes in a sphere to make it less geometrically perfect, so I put down the following code that uses my own personal getRandom function.

geomNodeCollection = self.boom1.findAllMatches('**/+GeomNode')
for nodePath in geomNodeCollection:
	geomNode = nodePath.node()
	for i in range(geomNode.getNumGeoms()):
		geom = geomNode.modifyGeom(i)
		vdata = geom.modifyVertexData()
		vRewriter = GeomVertexRewriter(vdata)
		while not vRewriter.isAtEnd():
			v = vRewriter.getData3f()
			vRewriter.setData3f(v[0] + getRandom(-10, 10), v[1] + getRandom(-10, 10), v[2] + getRandom(-10, 10))

I don’t get any errors, but the vertexes aren’t being moved. What am I doing wrong here?


vRewriter = GeomVertexRewriter(vdata, 'vertex')

If you don’t specify a column name, it doesn’t know what data to rewrite. Not sure why it’s not giving you errors, though; that must be a bug.


Thanks, that works now.