Hi,

I'm trying to pass string arrays stored in vtkPolyData sets through the pipeline, using Python programmable filters.
Below is a sample code :

In a ProgrammableSource1 :

   /output=self.GetOutput()/

   /
   /

   /points=vtk.vtkPoints()/

   /points.SetNumberOfPoints(1)/

   /points.SetPoint(0,0,0,0)/

   /
   /

   /stra=vtk.vtkStringArray()/

   /stra.SetName("hop")/

   /stra.Allocate(1)/

   /stra.InsertNextValue("hop")/

   /
   /

   /output.SetPoints(points)/

   /output.GetPointData().AddArray(stra)/

In a directly connected ProgrammableFilter1 :

/
//        input=self.GetInput()/

//

/output=self.GetOutput()/

//

/
/

//

/output.SetPoints(input.GetPoints())/

//

/output.GetPointData().CopyStructure(input.GetPointData())/

//

/
/

//

/print input.GetPointData().GetArray("hop")/


The result of the 'print' call at the end is "None", but should not be in my understanding. If we do the exact same thing with a vtkDoubleArray, it works.

Any idea on this issue ?

Thanks,

Yves

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to