[vtkusers] Saving PointSetData array

McCormick, Jeremy jeremym at slac.stanford.edu
Wed Dec 7 14:50:31 EST 2005


Hi.

I am assigning an array of floats to the PointSetData of my mapper.  But the PointSetData is replaced by a new object whenever Render() is called, so I need to call Render() first, as a workaround.  Otherwise, my array gets lost, because it isn't copied to the new PointSetData.  Maybe I'm going about this the wrong way and should be assigning the array someplace else, like directly to the polydata?  

attribs = vtkFloatArray("attributes")
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(polydata)
actor.SetMapper(mapper)        
mapper.Render(app.renderer, actor) # render first
mapper.GetInput().GetPointData().AddArray(attribs) # now add array

Thanks.

--Jeremy McCormick



More information about the vtkusers mailing list