A few more notes-<br><br>If you use the script I just posted, make sure the interactor is initialized before the first call to render- it must be initialized before the opengl window is created.<br><br>In the current version of paraview, it is not necessary to call Connect(), this is done automatically when paraview.simple is imported.<br>
<br>It's not a good idea to include the line: 'from paraview.servermanager import *'. You should just access servermanager methods via the sermanager namespace that is created when you import paraview.simple *.<br>
<br><br>Pat<br><br><br><div class="gmail_quote">On Wed, Jun 30, 2010 at 2:48 PM, pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Unfortunately, pvpython does not support render window interaction. But you can make it work with a extra scripting:<br><br>from paraview.simple import *<br><br># Create a view<br>view = CreateRenderView()<br><br># Initialize a new interactor<br>
from libvtkRenderingPython import *<br>iren = vtkRenderWindowInteractor()<br>iren.SetInteractorStyle(vtkInteractorStyleTrackball())<br>iren.SetRenderWindow(view.GetRenderWindow())<br>iren.Initialize()<br><br># Build pipeline<br>
Sphere()<br>Show()<br>Render()<br><br># Start interaction<br>iren.Start()<br><br><br>In interactive pvpython, you can go to the window and hit 'q' to give focus back to the command line, then call iren.Start() again to give focus back to the window.<br>
<br><br>Pat<br><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Jun 30, 2010 at 2:34 PM, Ted Thompson <span dir="ltr"><<a href="mailto:tedthompson61@gmail.com" target="_blank">tedthompson61@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
<div>I am trying to draw 3D graphics using the pvpython shell. The following file is named sphere.py</div>
<div> </div>
<div>-----------------------</div>
<div>import os</div>
<div>import paraview</div>
<div>from paraview.simple import *</div>
<div>from paraview.servermanager import *</div>
<div>Connect()</div>
<div>sph=Sphere()</div>
<div>Show(sph)</div>
<div>Render()</div>
<div>-------------------</div>
<div> </div>
<div>I execute the following command from a DOS cmd window:</div>
<div> </div>
<div>pvpython sphere.py</div>
<div> </div>
<div>These commands appear to work and a window is created showing the sphere but it immediately goes away. Do I need some type of wait command in the script? When I execute these commands interactively in the pvpython window the window locks up. When I execute them, minus the Connect() in the Paraview GUI provided Python window they work fine. </div>
<div> </div>
<div>I want a separate graphics window with no GUI shown.</div>
<div> </div>
<div>What am I missing here? </div>
<div> </div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>
</blockquote></div><br>