[Paraview] Trying to use offscreen rendering

Jacques Papper jacques.papper at gmail.com
Thu Dec 4 12:01:32 EST 2008


Hi,

I attach part of a script I wrote that loads in an ensight dataset, does
some filtering and then outputs the views I want to a file. I am wondering
what I should change in this script or in the way I use pvpython in order to
not get a black window pop up. If I use the
view.UseOffscreenRenderingForScreenshotsOn(), it doesn't seem to make much
of a difference (keeps the black screen but does not flicker through the
images).

Jacques



from paraview import servermanager

servermanager.Connect()

cs = CamState()
cs.loadState("/home/users/jacques.papper/ParaView/Templates/top_front_side.camstate")

view = servermanager.CreateRenderView()
#view.UseOffscreenRenderingForScreenshotsOn()
#servermanager.Register(view) < Could be done if we wanted to get the view
afterwards by calling GetRenderView()

cs.setRenderView(view)

#LOADING THE ENTIRE ENSIGHT DATASET

ensightReader=servermanager.sources.ensight(registrationGroup='sources',
CaseFileName="%s" % casefile)
ensightReader.UpdatePipelineInformation()
ensightReader.ByteOrder = 1
#ensightReader.UpdatePipeline()

#EXTRACTING ONLY THE SURFACES OF INTEREST

blockFilter=servermanager.filters.ExtractBlock(Input = ensightReader)
blockFilter.BlockIndices = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
blockFilter.PruneOutput = 1
#blockFilter.UpdatePipeline()

#REFLECTING DATA

reflectFilter = servermanager.filters.ReflectionFilter(Input = blockFilter)
reflectFilter.Center = 0.0
reflectFilter.CopyInput = 1
reflectFilter.Plane = 4
#reflectFilter.UpdatePipeline()

#CHOOSING WHAT GOES IN THE REPRESENTATION AND THE WAY IT IS REPRESENTED

rep = servermanager.CreateRepresentation(reflectFilter, view)
rep.Representation = 2 #Surface representation
#rep.SelectionVisibility = 1
rep.Visibility = 1


viewList=["front","side"]
for viewtype in viewList:
    cs.loadView(viewtype)
    view.StillRender()
    view.WriteImage("./test_pic_%s.png" % viewtype,"vtkPNGWriter")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20081204/4337b59e/attachment.htm>


More information about the ParaView mailing list