<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 14, 2015, at 6:40 PM, "Dougherty, Matthew T" <<a href="mailto:matthewd@bcm.edu">matthewd@bcm.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto; "><div style="margin-top: 0px; margin-bottom: 0px; ">Normally a save session by a python extension is invoked by a trigger SAVE_SESSION.<br></div></div></div></blockquote><div><br></div>Hi Matt, </div><div><br></div><div>Yes, most extensions will only use this trigger.</div><div><br><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto; "><div style="margin-top: 0px; margin-bottom: 0px; "><span style="font-size: 12pt; ">For restoring a session, several related chimera APIs are available that are typically not used.</span></div><div style="margin-top: 0px; margin-bottom: 0px; ">1) post model restore: SimpleSession.registerAfterModelsCB(afterModelsRestoredCB, arg)<br></div></div></div></blockquote><div><br></div>This is a pretty specialized trigger. It is used by the few tools/extensions that (as they restore) care about models possibly restored by other extensions, and not just the atomic and surface models restored by the core session code or by themselves. For example, the distance-monitor tool registers for this trigger since the session may show distances involving volume markers, which are restored by the VolumePath extension.</div><div><br><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto; "><div style="margin-top: 0px; margin-bottom: 0px; ">2) BEGIN_RESTORE_SESSION and END_RESTORE_SESSION triggers.<br></div></div></div></blockquote><div><br></div>These are used by tools not involved in the session restore directly, and generally to avoid processing the models created by the session restore or otherwise prevent code from executing during the restore. For example, there is code in Chimera that judges whether covalent bonds in newly opened models should be converted to metal-coordination pseudobonds. This code turns itself off during a session restore. Similarly "smart display" of new models is turned off during a restore.</div><div><br></div><div><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto; "><div style="margin-top: 0px; margin-bottom: 0px; ">I need to reset extension gui values based on midas positions. </div><div style="margin-top: 0px; margin-bottom: 0px; "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); ">I presume a normal restore in the session file does not guarantee that these midas positions will be loaded at that time, so I need to delay the gui updates until the restore process has ended or possibly when the models are loaded loaded.</span></span></div></div></div></blockquote><div><br></div>I think you've noticed that there are triggers that fire when positions are saved or deleted (ADD_POSITIONS / REMOVE_POSITIONS). Your GUI should clearly register for these triggers, and possibly for BEGIN/END_RESTORE_SESSION if you want to prevent or delay updates during a session restore.</div><div><br></div><div>--Eric</div><div><div><br> Eric Pettersen<br> UCSF Computer Graphics Lab<br> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a><br></div></div><div><br></div><div><br><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif; position: static; z-index: auto; "><div style="margin-top: 0px; margin-bottom: 0px; "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); "><br></span></span></div><div style="margin-top: 0px; margin-bottom: 0px; "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); "><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); ">What is the distinction between </span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); ">END_RESTORE_SESSION and registerAfterModelsCB?</span><br></span></span></div><div style="margin-top: 0px; margin-bottom: 0px; "><br></div><div id="Signature"><div class="BodyFragment"><font size="2"><div class="PlainText">Matthew Dougherty<br>National Center for Macromolecular Imaging<br>Baylor College of Medicine<br>===========================================================================</div></font></div></div></div>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a></div></blockquote></div><br></body></html>