VMD-L Mailing List
From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Thu Nov 08 2001 - 10:59:52 CST
- Next message: Barry Isralewitz: "Re: making a movie of trajectory file animation"
- Previous message: Raik Grunberg: "dementi: VMD freezes KDE under Linux Redhat = nVidia problem"
- In reply to: Raik Grunberg: "Re: more animating trajectories"
- Next in thread: Raik Grunberg: "dementi: VMD freezes KDE under Linux Redhat = nVidia problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
> On principle, it should work like this (version 1.0):
> -----------------------
> gopython # switch to python, I have no clue about Tcl!
Cool, Python!
>
> import VMDCallback
>
> def test(molid, frame): # define a method
> print "next, please"
>
> f2 = test
>
> VMDCallback.add_callback('frame',f2) # register the method
> ------------------------
>
> This prints a very useful message every frame and I would guess it could
> be used to change the coloring of each frame. I can't do it right now (and
> my vmd-scripting experience is extremely limited, i.e. near 0) but if
> anyone could give some hints ... :o)
Check the Python section of the User's Guide; the command you need is
molrep.modrep.
>
> I, in fact, already failed with the visibly more advanced version 2.0:
>
> def test(molid, frame): # define a method
> if frame % 50 == 0:
> print "next, please"
I think what you want is:
import math
def test(molid, frame):
if not math.fmod(frame, 50):
print "next, please"
>
> I could register this method but nothing happened..
>
> Thanks for comments!
> Raik
>
>
-- Justin Gullingsrud 3111 Beckman Institute H: (217) 384-4220 I got a million ideas that I ain't even rocked yet... W: (217) 244-8946 -- Mike D
- Next message: Barry Isralewitz: "Re: making a movie of trajectory file animation"
- Previous message: Raik Grunberg: "dementi: VMD freezes KDE under Linux Redhat = nVidia problem"
- In reply to: Raik Grunberg: "Re: more animating trajectories"
- Next in thread: Raik Grunberg: "dementi: VMD freezes KDE under Linux Redhat = nVidia problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]