<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 15, 2013, at 8:50 AM, Alex wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dear all,</div><div><br></div><div>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.</div><div>Unfortunately, I can't find a way to instanciate the dialog MovieDialog (Movie/gui.py) with a model already opened.</div><div>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.</div><div><br></div><div>I'm rather confused right now and would appreciate some help on the matter.</div></div></blockquote><br></div><div>Hi Alex,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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:</div><div><br></div><div>molecule attr: your Molecule instance</div><div>startFrame attr: 1</div><div>endFrame attr: the number of frames you have</div><div>name attr: name you want shown in the title bar</div><div>__len__ func: returns the number of frames</div><div><br></div><div>In addition, specify externalEnsemble=True in the keywords to the MovieDialog constructor.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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.</div><div><br></div><div>--Eric</div><div><br></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>