<HTML>
<HEAD>
<TITLE>Re: [Paraview] pvbatch: Manipulate file list of loaded state file</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>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.<BR>
<BR>
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.<BR>
<BR>
-Ken <BR>
<BR>
<BR>
On 10/11/09 1:55 PM, "Karl König" <<a href="kkoenig11@web.de">kkoenig11@web.de</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I've been trying to no avail for many hours now to do something that<BR>
sounds quite simple to do, but seems to be not yet documented in the PV<BR>
wiki, the tutorials, PV presentation slides nor the mailing list.<BR>
I hope someone can give me a hint what I'm doing wrong.<BR>
<BR>
The thing I'm trying to do is a variant of what Kent posted 1,5 year ago<BR>
about and Utkarsh gave advice on<BR>
(<a href="http://www.paraview.org/pipermail/paraview/2008-February/007134.html">http://www.paraview.org/pipermail/paraview/2008-February/007134.html</a>):<BR>
<BR>
1) Load a single file from a file series, not a file series, create a<BR>
pipeline and save a state file.<BR>
<BR>
2) Let pvbatch load the state file, swap the file for a file list<BR>
(determined via glob, see e.g. page 7 of<BR>
<a href="http://www.cscs.ch/fileadmin/user_upload/customers/users_entry_point/HORUS_Doc/PvPython.pdf">http://www.cscs.ch/fileadmin/user_upload/customers/users_entry_point/HORUS_Doc/PvPython.pdf</a>)<BR>
and iterate over all files<BR>
<BR>
I've successfully loaded the state file and manipulated the source<BR>
proxy's FileName property, extracted the scene object by means of<BR>
servermanager.ProxyManager, updated the animation scene's TimeKeeper<BR>
object and then repeatedly called scene.GoToNext(). But the new file<BR>
list got not respected, still only the file mentioned in the state file<BR>
gets loaded.<BR>
<BR>
I've also tried to create a new reader instance with the file list as<BR>
argument, looped over all source proxies within the state file and<BR>
changed their Input property in case that were a reader. Then, created a<BR>
new animation scene in the same way as AnimateReader does it in<BR>
Utilities/VTKPythonWrapping/paraview/servermanager.py and tried again to<BR>
loop over all files. Still not working.<BR>
Saving the state file from pvbatch and loading it into ParaView<BR>
confirmed that I'm missing something as ParaView spits out quite some<BR>
error messages for those objects I swapped the input for:<BR>
"Input port 0 of algorithm vtkExtractBlock has 0 connections but is not<BR>
optional."<BR>
<BR>
Is there someone who accomplished loading a state file and manipulating<BR>
the reader's file list and is willing to share his knowledge?<BR>
<BR>
Thanks a lot<BR>
Karl<BR>
<BR>
<BR>
N.B.:<BR>
If there is a solution to this problem, it could also pose an<BR>
approximate alternative solution for those looking for support for live<BR>
data in PV, an issue discussed just recently here: By means of a timer,<BR>
file size or file inspection it would be easy enough to have Python<BR>
ensure the validity of an input fill, then re-execute the pipeline for<BR>
the new file, create a snapshot automatically and wait for the next file<BR>
to appear.<BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:7.5pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>