[Paraview] pvbatch: how not to use screen at all?

Anton Shterenlikht mexas at bristol.ac.uk
Mon Mar 18 11:06:35 EDT 2013


The script below works for me in paraveiw 3.10
with pvpython and pvbatch. However, in pvbatch
it still opens a graphical window for a short time.
How can I modify the script to *not* open any
graphical windows when run with pvbatch?

Can I do away with CreateRenderView()?

Thanks

Anton

from paraview.simple import *
#Connect()
reader=ImageReader(FilePrefix="z.raw")
reader.DataByteOrder=1
reader.DataExtent=[1,40,1,40,1,40]
reader.DataScalarType=6

view = GetActiveView()
if not view:
 view = CreateRenderView()
view.ViewSize=[600,600]

Show()

dp = GetDisplayProperties(reader)
dp.LookupTable = MakeBlueToRedLT(1,64)
dp.ColorAttributeType = 'POINT_DATA'
dp.ColorArrayName = 'ImageFile'
dp.Representation="Surface"

camera = GetActiveCamera()
camera.SetViewUp(-1,0,0)
camera.Azimuth(30)
camera.Elevation(30)

#camera.SetPosition(0,0,100)
#camera.Roll(-90)

Render()

WriteImage("z.png")


More information about the ParaView mailing list