[Paraview] camera commands hang in python script

Sylvester Gerardson sylvester.gerardson at gmail.com
Fri Apr 4 09:34:35 EDT 2008


Utkarsh,

On Windows only precompiled 3.2.1. I'm not sure about linux. I will try the
CVS somewhere next week.

Sylvester

> -----Original Message-----
> From: paraview-bounces at paraview.org 
> [mailto:paraview-bounces at paraview.org] On Behalf Of Utkarsh Ayachit
> Sent: Friday, April 04, 2008 3:26 PM
> To: Iain Bethune
> Cc: paraview at paraview.org
> Subject: Re: [Paraview] camera commands hang in python script
> 
> Using camera through the python shell in the GUI had issues 
> in ParaView 
> 3.2. However, those issues should be fixed on the CVS head. Are you 
> using 3.2 or CVS Paraview?
> 
> Utkarsh
> 
> Iain Bethune wrote:
> > Interestingly, I tried today executing the same script 
> using pvbatch and it
> > works fine, it just seems to hang when using the python 
> shell in the GUI.
> > 
> > --
> > Iain Bethune
> > Applications Consultant, EPCC
> > 
> > Email: ibethune at epcc.ed.ac.uk
> > Tel/Fax: +44 (0)131 650 5201/6555
> > Addr: 2404 JCMB, King's Buildings, Mayfield Road, Edinburgh, EH9 3JZ
> > 
> > The University of Edinburgh is a charitable body, 
> registered in Scotland,
> > with registration number SC005336.
> > 
> >  
> > 
> > -----Original Message-----
> > From: paraview-bounces at paraview.org 
> [mailto:paraview-bounces at paraview.org]
> > On Behalf Of Sylvester Gerardson
> > Sent: 04 April 2008 10:01
> > To: paraview at paraview.org
> > Subject: Re: [Paraview] camera commands hang in python script
> > 
> > I'm experiencing the same problem, both on Windows and 
> Linux. Has anyone
> > been able to use python scripting to manipulate the camera?
> > 
> > Thanks!
> > Sylvester
> > 
> >> -----Original Message-----
> >> From: paraview-bounces at paraview.org 
> >> [mailto:paraview-bounces at paraview.org] On Behalf Of Iain Bethune
> >> Sent: Thursday, April 03, 2008 10:52 AM
> >> To: paraview at paraview.org
> >> Subject: [Paraview] camera commands hang in python script
> >>
> >> I've got a python script when runs OK, but hangs whenever I 
> >> do any camera
> >> manipulation commands e.g. camera.Roll(x) or 
> camera.Elevation(x).  I'm
> >> running PV 3.2.1 (downloaded binary) on Windows.  Any ideas 
> >> what I'm doing
> >> wrong?
> >>
> >> The script is:
> >>
> >> import time
> >>
> >> # Setup
> >>
> >> if servermanager.ActiveConnection :
> >> 	connection = servermanager.ActiveConnection
> >> else:
> >> 	connection = servermanager.Connect()
> >>
> >> # Get ready to read a file
> >>
> >> reader = servermanager.sources.ImageReader()
> >> reader.FilePrefix = 
> >> "Z:\\hpcx\\tera\\visualisation\\test_data\\32x32x32"
> >> reader.DataExtent = [0, 31, 0, 31, 0, 31]
> >> reader.DataScalarType = 10
> >>
> >> # Read the file
> >>
> >> view = servermanager.CreateRenderView()
> >> rep = servermanager.CreateRepresentation(reader, view)
> >>
> >> # Set up how to draw the data
> >>
> >> ai =
> >> reader.GetDataInformation().GetPointDataInformation().GetArray
> >> Information(0)
> >> lt = servermanager.rendering.PVLookupTable()
> >> rep.LookupTable = lt
> >> rep.ColorAttributeType = 0
> >> rep.ColorArrayName = "ImageFile"
> >> lt.RGBPoints = [ai.GetComponentRange(0)[0], 0, 0, 1,
> >> ai.GetComponentRange(0)[1], 1, 0, 0]
> >> lt.ColorSpace = 1
> >>
> >> # Draw
> >>
> >> print "Setup, now rendering..."
> >> print time.clock()
> >>
> >>
> >>
> >> view.StillRender()
> >> view.ResetCamera()
> >> camera = view.GetActiveCamera()
> >> camera.Elevation(45.0)   <--- HANGS HERE
> >> view.StillRender()
> >>
> >> print time.clock()
> >>
> >> print"Finished rendering"
> >>
> >> # Save the file
> >>
> >> view.WriteImage("Z:\\hpcx\\tera\\visualisation\\testimg.png",
> >> "vtkPNGWriter", 1)
> >>
> >> print time.clock()
> >> print "Finished saving file"
> >>
> >> Cheers
> >>
> >> - Iain
> >>
> >> --
> >> Iain Bethune
> >> Applications Consultant, EPCC
> >>
> >> Email: ibethune at epcc.ed.ac.uk
> >> Tel/Fax: +44 (0)131 650 5201/6555
> >> Addr: 2404 JCMB, King's Buildings, Mayfield Road, 
> Edinburgh, EH9 3JZ
> >>
> >> The University of Edinburgh is a charitable body, registered 
> >> in Scotland,
> >> with registration number SC005336.
> >>
> >>  
> >>
> >>
> >> _______________________________________________
> >> ParaView mailing list
> >> ParaView at paraview.org
> >> http://www.paraview.org/mailman/listinfo/paraview
> > 
> > _______________________________________________
> > ParaView mailing list
> > ParaView at paraview.org
> > http://www.paraview.org/mailman/listinfo/paraview
> > 
> > _______________________________________________
> > ParaView mailing list
> > ParaView at paraview.org
> > http://www.paraview.org/mailman/listinfo/paraview
> > 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list