[Paraview-developers] Control paraview interactively using IDLE?
Cory Quammen
cory.quammen at kitware.com
Sat Jul 22 09:44:01 EDT 2017
Amine,
As far as I am aware, I'm afraid that you will not be able to control
the paraview UI from an external Python. The ParaView GUI owns its
internal Python environment, and the Python environment (including the
paraview.simple module) does not have a direct reference to the
ParaView GUI side of things. It may appear that you are controlling
the GUI via Python in ParaView's Python console, but that happens
indirectly. Your Python script change objects in ParaView, but the UI
changes you see are the result of observers in the UI listening for
updates to ParaView's state and updating themselves based on the new
values. The Python script does not control the UI elements directly.
The reason you see a separate render window is because running pure
Python scripts through pvpython or pvbatch, which are basically Python
executables with some additional path information, is explicitly
supported - the lone window appears when rendering commands are issued
in the script. What you have done with an external (and compatible)
Python is also supported, but it does not let you invoke the GUI
application, let alone control it.
Hope that helps,
Cory
On Sat, Jul 22, 2017 at 2:02 AM, Amine Aboufirass
<amine.aboufirass at gmail.com> wrote:
> I am trying to control Paraview interactively using IDLE. This would involve
> sending commands from IDLE and seeing the changes occur in Paraview. I would
> rather not use the in-Paraview python shell.
>
> So far, I have succeeded in importing the Paraview modules (simple,
> servermanager…etc) from IDLE. However the commands sent do not reflect in
> Paraview. For instance:
>
>>>> from paraview.simple import *
>>>> cone = Cone()
>>>> Show()
>>>> Render()
>
> does indeed create a cone. However the cone is output to a new, independent
> OpenGL window, and not the Paraview GUI.
>
> Is it possible to control Paraview interactively using IDLE? If so how to
> accomplish this? Thanks
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.
More information about the Paraview-developers
mailing list