Re: vmd-l: Problem with VMD 'animate' command

From: Axel Kohlmeyer (akohlmey_at_vitae.cmm.upenn.edu)
Date: Sun Feb 12 2006 - 20:00:46 CST

On Sun, 12 Feb 2006, John Stone wrote:

JS> Hi,
JS> Try adding "display update ui" right after the "animate goto" command.
JS> Let me know if that cures your problem.

hi,

isn't there a 'molinfo $mol set frame $val' command?
i just made a minimal test and it worked fine and
seems generally more logical and 'orthogonal' to me.
should be much faster, too. as it does not advance
the visualization...

regards,
    axel.

JS>
JS> John Stone
JS> vmd_at_ks.uiuc.edu
JS>
JS>
JS> On Sun, Feb 12, 2006 at 08:12:36AM -0800, Chandra Ramananjara wrote:
JS> > Hi Everyone,
JS> > I am having problems using the 'animate' command in VMD and I was wondering if anyone has encountered this problem as well.
JS> > I am writing a small & simple Tcl script that steps through the frames of my .dcd trajectory file and prints out the unit cell length of the ensemble in each frame. Something like this:
JS> >
JS> > for { set i $startnum } { $i < $endnum } { incr i $skipnum } {
JS> >
JS> > animate goto $i
JS> > set ucl [molinfo top get a]
JS> > puts $ucl
JS> >
JS> > }
JS> >
JS> > The output I get seems to suggest that the 'animate goto' command doesn't actually change the frame.
JS> >
JS> > I experimented a bit and here's what I found out. Starting from scratch, if I load my pdb/dcd file in VMD, and manually set the frame to 0 (using the slide tool on the VMD Main window), then run a simple tcl script (in the VMD TkConsole) to attempt to switch to some random frame, say frame 8:
JS> >
JS> > animate goto 8
JS> > puts [molinfo top get frame]
JS> >
JS> > I get 0 as the output, instead of 8. Which means the 'animate goto 8' command in the script I ran doesn't actually change the frame while the program is running. Then if I immediately run another tcl script (trying to switch to some other random frame):
JS> >
JS> > animate goto 22
JS> > puts [molinfo top get frame]
JS> >
JS> > I get 8 as the output, instead of 22. This means that the 'animate goto' command only goes into effect after the program finishes running, not while it's running. So the first script I ran (using 'animate goto 8') did work, it just didn't switch to frame 8 until after the program finished running, which isn't very useful. To verify this, I immediately tried the following script:
JS> >
JS> > animate goto 14
JS> > puts [molinfo top get frame]
JS> >
JS> > And of course, the output is 22 as expected, not 14.
JS> >
JS> > Any suggestions as to how to get the 'animate' command to switch frames dynamically or on the fly ? This is a really odd bug. Does it have anything to do with the fact that I am compiling/running the script using the VMD TkConsole window provided in the graphics version of VMD ?
JS> >
JS> > Thanks,
JS> > Chandra Ramananjara, PhD.
JS> >
JS> >
JS> > ---------------------------------
JS> > Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.
JS>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:43:18 CST