From: Justin Gullingsrud (jgulling_at_mccammon.ucsd.edu)
Date: Thu Oct 30 2003 - 09:29:46 CST

Hi,

I bet what's happening is that VMD assumes that it has the only OpenGL
context, so when VTK starts up, VMD's OpenGL window is no longer valid.
  The only way to make them work in the same process would be to either
make VMD more paranoid about extensions stealing the OpenGL context, or
by having the extension "play nice" by saving the current context and
drawable, then restoring them when finished drawing. If you're
comfortable communicating with VTK through a pipe, this would be the
easiest solution.

Cheers,
Justin

On Oct 30, 2003, at 6:21 AM, Lars Bruno Hansen wrote:

>
> dear VMD users,
>
> I have a question about running VMD and VTK (Visual Tool Kit) together,
> using VMD's python interpreter. VTK can be called directly from python.
>
> I have a set of localized orbitals, and have a representation of these
> as spheres, which I can visualize in VMD, possible together with the
> molecule itself.
> I would then like to pick an orbital in VMD and have this orbital
> shown as a 3D plot in VTK. The VTK graphics runs in a Tk window.
>
> The VTK window opens fine from within the VMD python interpreter,
> you can rotate the view in the VTK window and you still have the
> the VMD python window active, also the VMD Main menu works fine,
> however VMD's openGl window is not redrawn.
> Trying to close the VTK window and delete the VTK objects from
> the python session does not help, also the VMD command 'reset view',
> does not restore control to VMD's openGL window.
>
> I do not know if one in general can have these two graphics loop
> running together in the same process, or if you will have to
> start VMD and VTK as independent processes and then communicate
> via a pipe or similar?
>
> Any help on this is greatly appreciated.
>
> I am running vmd 1.8.1 openGL version on linux redhat 9.0.
>
> with best regards
> Lars
>
> --
> Lars Bruno Hansen,
> CAMP, Dept. of Physics, Building 307, DTU, DK-2800 Lyngby, Denmark
> Phone: +45 45 25 32 16 Fax: +45 45 93 23 99
> E-mail: lhansen_at_fysik.dtu.dk
>
>

--
It is easier to make a theory of everything, than a theory of 
something. -- Aharon Katchalsky