<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Raju,<div><span class="Apple-tab-span" style="white-space:pre"> </span>During the execution of a Python script, Chimera does not redraw the graphics screen until explicitly requested or when the script ends. The simplest way to ask for a redraw is to execute the "wait 1" Chimera command, which you can do from Python with:</div><div><br></div><div>from chimera import runCommand</div><div>runCommand("wait 1")</div><div><br></div><div>So if you embed that in your loop you should be able to see your atom move. Frames are redrawn at a rate of 25 per second (though future versions of Chimera may allow faster redraw rates), so you may want to wait more than 1 frame if the atoms moves too fast.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Alternatively, there is also a direct Python call to wait():</div><div><br></div><div>from Midas import wait</div><div>wait(1)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>FYI, there is another mailing list, chimera-dev, where programming-intensive questions like this one are more appropriate, so that the regular user's eyes don't glaze over. :-)</div><div><br></div><div>--Eric</div><div><br></div><div><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></div><br class="Apple-interchange-newline"></span></div><div><div>On Jul 10, 2012, at 9:07 AM, Raju Purohit wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hello friends,<div><br></div><div>I need some help here.</div><div><br></div><div>I created a basic model having just an atom and set its coordinates as (0,0,0). Now I want to make it move along a certain path defined mathematically (say, along x axis) and I need to see it move. So I used a <b>for</b> loop. But I couldn't see and motion and soon realised that the loop is very quick in executing and thus I could see the atom at its last coordinates. So I tried to add delay of 0.5 seconds for each loop by importing <b>time</b> module and useing <b>time.sleep</b>. But still I couldn't see any motion and the coordinates of the atom is set only at the end of the <b>for</b> loop. I could not see the intermediate path. I am sure you people must have tried this earlier and this problem has a solution but I just couldn't figure it out. </div>
<div><br></div><div>Can you please help me out?</div><div><br></div><div>Thank you in advance.<br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Raju R.N.</div><div>Third Year, B.Tech</div><div>Mechanical Engineering</div>
<div>National Institute of Technology Karnataka, Surathkal</div></div><br>
</div></div>
_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users<br></blockquote></div><br></div><br><br></body></html>