[Paraview] pvbatch: Manipulate file list of loaded state file
Karl König
kkoenig11 at web.de
Sun Oct 11 15:55:06 EDT 2009
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.
More information about the ParaView
mailing list