[Paraview] Trying to use offscreen rendering

Berk Geveci berk.geveci at kitware.com
Tue Dec 9 11:29:25 EST 2008


I can't remember if I answered this question. The only way of not
getting the window is to compile ParaView with Mesa offscreen support
on Linux. Otherwise, you have to live with the annoyance of the
window. It is OK to send that window to the background or even
minimize it though.

-berk

2008/12/4 Jacques Papper <jacques.papper at gmail.com>:
> 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")
>
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list