[Paraview] Transform Filter Loses Colors
David Doria
daviddoria at gmail.com
Fri Sep 11 12:42:19 EDT 2009
On Fri, Sep 11, 2009 at 12:25 PM, Sven Buijssen <
sven.buijssen at tu-dortmund.de> wrote:
> Actually, the loop got accidentally more complicated than necessary:
>
> ---
> inp = self.GetInput()
> out = self.GetOutput()
>
> numCells = inp.GetNumberOfCells()
> data = inp.GetCellData().GetArray("Colors")
>
> newData = vtk.vtkUnsignedCharArray()
> newData.SetName('Colors_converted')
> newData.SetNumberOfComponents(3)
> for i in range(0, 3*numCells):
> val = int(data.GetValue(i))
> newData.InsertNextValue(val)
> out.GetCellData().AddArray(newData)
> ---
>
> Sven
>
>
Sven,
Thanks, that works perfectly! I'll email vtk-devel asking why this happens.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090911/4b8fcc60/attachment.htm>
More information about the ParaView
mailing list