[Paraview] Getting Python object reference to representation/proxy of each object loaded in Paraview.

Deij, Menno M.Deij at marin.nl
Mon Feb 27 10:01:31 EST 2012


Ah, OK. I thought that my code below rotates the object. Closer inspection shows that it indeed does not, to my surprise I have to say.

In that case you want to use a Transform filter. Add it after your source and then open the Animation view. In your animation view add the transform rotation, for instance Rotate(0). Animate it from the first to the last value in the desired amount of steps & save the animation.

See the attached example PVSM file (Paraview version 3.10.1), just load & press play.

Gr.
Menno




dr. ir. Menno A. Deij
Software Engineer
Maritime Simulation Group
E mailto:M.Deij at marin.nl
T +31 317 49 35 06

MARIN
2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands
T +31 317 49 39 11, F , I www.marin.nl

-----Original Message-----
From: Olumide [mailto:50295 at web.de]
Sent: Monday, February 27, 2012 3:27 PM
To: Deij, Menno
Cc: paraview at paraview.org
Subject: Re: [Paraview] Getting Python object reference to representation/proxy of each object loaded in Paraview.

On 27/02/2012 12:59, Deij, Menno wrote:
> I'd do something like this:
>
> view = GetRenderView()
>
> for angle in range(0,360,10):
>          for rep in view.Representations:
>                  rep.Orientation = [angle,0,0] #rotate to your liking
>                  view.StillRender()
>                  view.WriteImage('image'+str(angle)+'.png', 'vtkPNGWriter', 1)
>

Thanks Menno. However I'm trying to rotate the objects in the scene and
not the camera. I've got two objects side by side and I'd like to rotate
both of them while keeping the camera still.

Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotate.pvsm
Type: application/octet-stream
Size: 175806 bytes
Desc: rotate.pvsm
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120227/33fb1303/attachment-0001.obj>


More information about the ParaView mailing list