[Paraview] ParaView python scripting - capture from ParaView GUI

Su, Simon M CTR USAF (US) simon.m.su.ctr at mail.mil
Thu Apr 3 11:56:52 EDT 2014


Hello there,

I am trying to cook up a batch file for the visualization pipeline that I am doing on ParaView GUI so that I can run that same sequence in batch mode and in parallel using pvbatch. I can get most of the python script using the Tool->Start Trace option on ParaView GUI. However, Start Trace didn't capture python script when I do a File->Save Data command.

For example, if I open up ParaView 4.1.0 and do a Tool->Start Trace, and then load up a cone and hit Apply and then do a File-> Save Data into legacy vtk format, and then do a Tool->Stop Trace, I will get the following python script

------------------ start python script ------------------

try: paraview.simple

except: from paraview.simple import *

paraview.simple._DisableFirstRenderCameraReset()


Cone1 = Cone()


RenderView1 = GetRenderView()


DataRepresentation1 = Show()

DataRepresentation1.ScaleFactor = 0.1

DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]


RenderView1.CameraPosition = [0.0, 0.0, 3.2036135254332487]

RenderView1.CameraClippingRange = [2.309882128879306, 4.336364527086367]

RenderView1.CameraParallelScale = 0.8291561935301535


Render()


------------- end python script -------------------

I will get the cone data saved to legacy vtk format in a file
[simonsm at abc ~]$ cat test.vtk
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 7 float
0.5 0 0 -0.5 0.5 0 -0.5 0.25 0.433013
-0.5 -0.25 0.433013 -0.5 -0.5 6.12323e-17 -0.5 -0.25 -0.433013
-0.5 0.25 -0.433013
POLYGONS 7 31
6 6 5 4 3 2 1
3 0 1 2
3 0 2 3
3 0 3 4
3 0 4 5
3 0 5 6
3 0 6 1

So, what is the python script command I need to save the data and how do I turn the python script from the Start Trace output into python script that I can run with pvbatch? Anything I need to strip off the output?

thanks
-simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140403/2213c4d1/attachment.html>


More information about the ParaView mailing list