The included script is designed to allow the user to manipulate the camera position, the first test I wrote<br>was the ability to reset the camera to positive X, negative Y etc. The problem is that the changes to the camera
<br>position are not updating untill I actually manually focus the render window. I presume the problem is that I am <br>not updating a key component. Can anybody tell me what one I am missing?<br><br>#!/usr/bin/env python
<br><br>import paraview<br>#camera is an already defined class<br>class Cam:<br> def PosX(self):<br> Cam.__Reset(self,1, 0, 0, 0, 0, 1)<br> def NegX(self):<br> Cam.__Reset(self,-1, 0, 0, 0, 0, 1)<br> def PosY(self):
<br> Cam.__Reset(self,0, 1, 0, 0, 0, 1)<br> def NegY(self):<br> Cam.__Reset(self,0, -1, 0, 0, 0, 1)<br> def PosZ(self):<br> Cam.__Reset(self,0, 0, 1, 0, 1, 0);<br> def NegZ(self):<br> Cam.__Reset(self,0, 0, -1, 0, 1, 0);
<br> #Private Methods<br> def __Reset(self,look_x, look_y, look_z,up_x,up_y,up_z): <br> pxm = paraview.pyProxyManager()<br> iter = pxm.group_iter("view_modules")<br> activeView = None<br> for proxy in iter:
<br> if proxy.IsA("vtkSMRenderModuleProxy"):<br> activeView = proxy<br> break<br> if activeView:<br> activeView.SetCameraPosition(0, 0, 0);<br> activeView.SetCameraFocalPoint(look_x,look_y,look_z)
<br> activeView.SetCameraViewUp(up_x,up_y,up_z) <br> activeView.ResetCamera()<br> activeView.UpdateVTKObjects()<br>