[Paraview] Change reader file name in python loaded state

Eric E. Monson emonson at cs.duke.edu
Thu Feb 19 19:35:10 EST 2009


Hey again,

Back maybe around PV 3.2, I could load a state file in Python (outside  
of PV) which included readers for pvd files. I could find the proxies  
for the file readers, and then change the file name, update the  
pipeline, and then save or display an animation using the new data  
set. I haven't tried this for a while because I'm now working with  
Xdmf files, and the reader didn't work with ParaView & Python well  
enough until more recently.

Now, when I try the same scripts, the reader on which I change the  
file name doesn't show anything at all in the render view. (i.e. I  
have two readers in my pipeline -- if I don't change any file names I  
can load in the state file and animate fine -- if I change one file  
name only that element of my visualization drops out, but I can see  
and animate the other -- if I change both names the renderview looks  
blank during the whole animation.)

I'm doing something like:

from paraview import servermanger
servermanager.Connect()
servermanager.LoadState("/Users/emonson/Data/StateFile.pvsm")
pm = servermanager.ProxyManager()

reader = pm.GetProxy("sources","OriginalDataSet.xmf")
reader.FileName = "/Users/emonson/Data/NewDataSet.xmf"
reader.UpdatePipeline()
view = servermanager.GetRenderView()
view.StillRender()

I see that in CVS there is a reader.FileNameChanged(), but calling  
that doesn't seem to fix it.

Is there something obvious I'm failing to do, or does this look like  
this should work?

Thanks,
-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group


More information about the ParaView mailing list