[chimera-dev] Trajectory and MD Movie GUI
Eric Pettersen
pett at cgl.ucsf.edu
Tue Apr 16 10:56:34 PDT 2013
On Apr 15, 2013, at 8:50 AM, Alex wrote:
> Dear all,
>
> I'm developing a plugin and would like to add frames to a model on the fly and being able to use the trajectory (MD Movie) GUI to navigate among the frames.
> Unfortunately, I can't find a way to instanciate the dialog MovieDialog (Movie/gui.py) with a model already opened.
> It seems that I have to use an Ensemble object (Trajectory/__init.py__) but its constructor requires another ensemble, and the Ensemble objects seem to be created inside MovieDialog's constructor.
>
> I'm rather confused right now and would appreciate some help on the matter.
Hi Alex,
I didn't originally write that code and if I were to rewrite it from scratch it wouldn't be quite so obscure, but nonetheless what you want to do isn't hard, given the right knowhow. You need to construct an ensemble object to hand off to the MovieDialog constructor. Just declare a class that inherits from nothing and has the following:
molecule attr: your Molecule instance
startFrame attr: 1
endFrame attr: the number of frames you have
name attr: name you want shown in the title bar
__len__ func: returns the number of frames
In addition, specify externalEnsemble=True in the keywords to the MovieDialog constructor.
I'm assuming that all the "frames added on the fly" have already been added when you bring up the MovieDialog. If some will be added later, that's more complicated (but doable I think). Anyway, if you have more questions feel free to ask.
--Eric
Eric Pettersen
UCSF Computer Graphics Lab
http://www.cgl.ucsf.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20130416/360d7757/attachment.html>
More information about the Chimera-dev
mailing list