[chimera-dev] [Chimera-users] Ignored settings

Eric Pettersen pett at cgl.ucsf.edu
Mon Aug 24 12:19:26 PDT 2009

Hi Mark,
	I don't know how you're opening these molecules but if you're using  
the "open" command then providing the "noprefs" keyword will prevent  
smart display.  Also, if you are using openModels.open() or  
openModels.add() then there is a 'noprefs' keyword that you could  
specify as False.  The 'noprefs' keyword for the open command has been  
around for awhile, but that keyword is new for the openModels  
functions, so if your plugin needs to work with a variety of Chimera  
versions either you will need to introspect the openModels function  
(using Python's inspect module, probably the getargspec function) or  
check chimera.version.  I actually recommend the inspect approach  
since the format of chimera.version has changed over time, so inspect  
is more bulletproof.
	Using that setAttr command for stickScale works for me.  You are  
aware that stickScale defaults to 1, right?
	There will be some minimal speed advantage to using direct Python  
calls to runCommand (elimination of some of the text parsing), but I  
would only expect the difference to be noticeable if we are talking  
about thousands of calls to the functions.  I guess I'm referring to  
the type of code you sent, where the Midas-module equivalent function  
is called (so only the parsing is eliminated).  There certainly could  
be more savings in some cases where the generic Midas-module code is  
replaced by special-purpose code.


On Aug 24, 2009, at 11:42 AM, Mark Moll wrote:

> Eric,
> I'm observing some odd behavior with a recent daily build (build  
> 28565) that may be related to this. I am working on a plugin that  
> creates new models. *After* the chimera models have been created,  
> the plugin runs a number of Midas commands in the python code:
> 	Midas.undisplay('element.H')
> 	Midas.represent('stick','#')
> 	Midas.represent('bs','@ca')
> 	Midas.color('byhetero','#')
> 	Midas.setAttr('m','stickScale',1,'#')
> 	Midas.setAttr('m','ballScale',.35,'#')
> This doesn't seem to have the desired effect. Turning off "smart  
> initial display" works a little better, but the stickScale command  
> still has no effect...
> (BTW, is there any speed advantage to using python commands rather  
> than runCommand statements?)
> -- 
> Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20090824/93fba5e2/attachment.html>

More information about the Chimera-dev mailing list