[Paraview] Python Scripting w/Ensight reader trouble

Kent Eschenberg eschenbe at psc.edu
Tue Mar 25 17:19:59 EDT 2008


This is a really wild guess: in all the other examples I've seen there is another 
StillRender just before the ResetCamera. Maybe its needed for ResetCamera to figure out where to point the camera?

Kent

David Farrell wrote:
> Hi All,
> 
> I am trying to read in some ensight data, and render it (for now, just 
> as points... later I will get into the thresholds and glyphs).. 
> unfortunately, I must be missing something in my script as I only get a 
> black canvas when I write to file. Any ideas? An example would be most 
> excellent - though I have to admit I haven't been able to follow the 
> exodus ones particularly well (since I don't have any exodus data I 
> can't test it).
> 
> 
> Thanks in advance,
> 
> Dave
> 
> 
> here is what my script looks like, I have been running it as 'pvpython 
> <filename>'
> 
> from paraview import servermanager
> 
> # Set up the connection to the Paraview Server
> if not servermanager.ActiveConnection:
> connection = servermanager.Connect()
> if not connection: 
> raise exceptions.RuntimeError, "Connection to server failed."
> 
> # create an ensight source object
> ensightSource = servermanager.sources.ensight()
> ensightSource.CaseFileName = 
> "/Users/davidfarrell/Code/Paraview/last_step_init_col_occ_out.case"
> ensightSource.UpdatePipelineInformation()
> 
>  
> 
> # Set up the view, render to a file
> view = servermanager.CreateRenderView()
> rep = servermanager.CreateRepresentation(ensightSource, view)
> view.ResetCamera()
> view.StillRender()
> 
> view.WriteImage("image.png", "vtkPNGWriter", 1)


More information about the ParaView mailing list