[Paraview] Convert file types with python

David Doria daviddoria at gmail.com
Fri Apr 24 13:04:41 EDT 2009


I want to open some .ply files and save them as .vtp files in a python
script.

For reading vtp's, I've used
reader = servermanager.sources.XMLPolyDataReader(FileName=ModelFilename)

I saw there was a vtkPly class, so I tried
    reader = servermanager.sources.PlyFile(FileName=ModelFilename)
and it says "no attribute PlyFile"

For writing a vtp, I thought it may be something like
rep.XMLPolyDataWriter(NewFilename)
or
servermanager.sources.XMLPolyDataWriter(NewFilename)

but both give errors.

Anyone know how to do this?

Also, I'm curious why Paraview does not have the ability to import .obj
files? That seems to be what many algorithms take as input and give as
output, so I find myself using Blender to convert obj to ply, then Paraview
to convert ply to vtp. Does anyone else think it would be nice to support
.obj's?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090424/4807fbe9/attachment.htm>


More information about the ParaView mailing list