[Paraview] pvbatch: Manipulate file list of loaded state file

Moreland, Kenneth kmorel at sandia.gov
Mon Oct 12 18:52:03 EDT 2009


Hopefully someone will have answered your question by the time I get off this airplane and sync my email so that this message gets sent, but allow me to suggest an alternative method.  I recommend you try the new Python tracing as an alternative.  To do this, turn on Python tracing (currently attached to the Python shell, but should move soon), load the file, set up the pipeline and any other desired state, and then save the state.  Load the resulting Python shell in your favorite editor and change it to load the files you really want.

This use case of loading state files is really just a workaround to the fact that you could not directly output a Python script from ParaView.  Now that you can automatically create scripts from within ParaView, loading state files from scripts is (mostly) obsolete.

-Ken


On 10/11/09 1:55 PM, "Karl König" <kkoenig11 at web.de> wrote:

Hi,

I've been trying to no avail for many hours now to do something that
sounds quite simple to do, but seems to be not yet documented in the PV
wiki, the tutorials, PV presentation slides nor the mailing list.
I hope someone can give me a hint what I'm doing wrong.

The thing I'm trying to do is a variant of what Kent posted 1,5 year ago
about and Utkarsh gave advice on
(http://www.paraview.org/pipermail/paraview/2008-February/007134.html):

1) Load a single file from a file series, not a file series, create a
pipeline and save a state file.

2) Let pvbatch load the state file, swap the file for a file list
(determined via glob, see e.g. page 7 of
http://www.cscs.ch/fileadmin/user_upload/customers/users_entry_point/HORUS_Doc/PvPython.pdf)
and iterate over all files

I've successfully loaded the state file and manipulated the source
proxy's FileName property, extracted the scene object by means of
servermanager.ProxyManager, updated the animation scene's TimeKeeper
object and then repeatedly called scene.GoToNext(). But the new file
list got not respected, still only the file mentioned in the state file
gets loaded.

I've also tried to create a new reader instance with the file list as
argument, looped over all source proxies within the state file and
changed their Input property in case that were a reader. Then, created a
new animation scene in the same way as AnimateReader does it in
Utilities/VTKPythonWrapping/paraview/servermanager.py and tried again to
loop over all files. Still not working.
Saving the state file from pvbatch and loading it into ParaView
confirmed that I'm missing something as ParaView spits out quite some
error messages for those objects I swapped the input for:
"Input port 0 of algorithm vtkExtractBlock has 0 connections but is not
optional."

Is there someone who accomplished loading a state file and manipulating
the reader's file list and is willing to share his knowledge?

Thanks a lot
Karl


N.B.:
If there is a solution to this problem, it could also pose an
approximate alternative solution for those looking for support for live
data in PV, an issue discussed just recently here: By means of a timer,
file size or file inspection it would be easy enough to have Python
ensure the validity of an input fill, then re-execute the pipeline for
the new file, create a snapshot automatically and wait for the next file
to appear.
_______________________________________________
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




   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20091012/d6762766/attachment.htm>


More information about the ParaView mailing list