[Paraview] Using pvpython to load states with filenames

Bill Sherman shermanw at indiana.edu
Tue May 20 16:42:57 EDT 2014


Hey Ken,

Thanks for the response.

> This doesn't answer your question but instead provides an alternative. You
> can save the state as a python script. Since the point is to recreate the
> state within a pvpython, this might be a more natural way to do it anyway.
> The Python script should be straightforward to edit to use variables for
> filenames instead of constants.

Sure, alternatives are always good to know about.  I just did some tests
though, and while I can basically use the same sed script (or vim commands)
to adjust the directory name, it seems as though the python version of
the state file does not capture the animation settings/cues, which I
suppose is a bug in the python-state writing method.

For example:

 >>> from paraview.simple import *
paraview version 4.0.1
 >>> servermanager.LoadState("testC2.pvsm")
 >>> scene = GetAnimationScene()
 >>> scene.Cues
[<paraview.servermanager.TimeAnimationCue object at 0x1d378d0>, 
<paraview.servermanager.CameraAnimationCue object at 0x1d37c10>]


Vs:

 >>> execfile("testC2.py")
paraview version 4.0.1
 >>> scene = GetAnimationScene()
 >>> scene.Cues
[]


But I'll keep this in my expanding repertoire of how to learn what
python commands are available in pvpython!

> -Ken

	Thanks,
	Bill


More information about the ParaView mailing list