[vtkusers] vtkCellArray and vtkPolyData

Paul Cochrane cochrane at esscc.uq.edu.au
Thu Mar 31 19:42:02 EST 2005


Alexandre,

The problem you're seeing is because the variable 'input' isn't being
created, and then you're trying to use a method call on what python thinks
is a variable of 'NoneType'.  

The offending lines of code are:

> input = PolyData.SetPoints(points)
> input = PolyData.SetPolys(polys)
> input.UpdateInformation()

Which I think you want to change to:

PolyData.SetPoints(points)
PolyData.SetPolys(polys)
PolyData.UpdateInformation()  # not sure if you need this line

The problem is that PolyData.SetPoints(points) doesn't actually return
anything (the same with PolyData.SetPolys(polys)), hence input is set to
None by python, and calling UpdateInformation() can't do anything.

I hope that helps a bit.

Regards,

Paul

-- 
Paul Cochrane
Computational Scientist/Software Developer
Earth Systems Science Computational Centre
Rm 703, SMI Building
University of Queensland
Brisbane
Queensland 4072
Australia

E: cochrane at esscc.uq.edu.au
P: +61 7 3346 4109
F: +61 7 3365 7347



More information about the vtkusers mailing list