vtk-python and serialization

Vetle Roeim vetler at ifi.uio.no
Fri May 5 11:54:39 EDT 2000


on 2000-05-05, David Gobbi wrote:

> > I have som questions about the python bindings for vtk.. Before I ask the
> > questions, I'd just like to say that I'm no Python expert ;-)
> > 
> > - Would it be possible to serialize the vtk objects somehow? I gave it a
> > shot with the pickle module, but it dumped core.
> 
> No, it isn't and this would be fairly hard to add.  You might be able
> to find a way for pickle to work via the object readers/writers using
> temporary files or named pipes.  This would only work for the data
> classes, there is no way to do something similar to a chunk of VTK
> pipeline.  

hmm.. too bad. it would be really nice to be able to do this.

[snip]
> > .. and why does the object write all this?
> 
> Well, because the python 'print' is translated directly 
> into camera->Print(stdout).  

ah, yes. I thought it might be something like that..

> Yes, I agree, this is silly, especially if you try to print a list of
> several VTK objects.
>
> The solution would be to change the python wrappers so that
> you can use camera.Print() instead.  Then, repr(camera) 
> could be changed so that it returned '<vtkCamera at 2ff3f8>'
> which is much more consistent with the Python way of doing things.
> I might shy away from printing 'instance' because vtk objects
> are not instances of python classes.

will this change be made?

thanks for clearing things up, David.


vr
--
Vetle Roeim 
Graduate Student 
Departement of Informatics, University of Oslo, Norway


--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list