[chimera-dev] AIMAll extension update 1
Eric Pettersen
pett at cgl.ucsf.edu
Fri Jan 9 11:14:44 PST 2015
On Jan 9, 2015, at 9:18 AM, ros <rodrigogalindo at gmail.com> wrote:
> I get an:
> NameError: global name 'chimera' is not defined
>
> File "/home/ros/work2/chimera-plugin/ReadAimall/__init__.py", line
> 54, in readAimall
> a.color = chimera.MaterialColor(1,0,0,1)
>
> See reply log for Python traceback.
>
> I tried adding:
> import chimera or add MaterialColor in:
>
> ;;;from chimera import Coord, connectMolecule, MaterialColor
>
> at the start of the code and it stills shows the default color for
> Helium atoms (which I am using as dummy atoms)
you need either:
import chimera
a.color = chimera.MaterialColor(1,0,0,1)
or:
from chimera import MaterialColor
a.color = MaterialColor(1,0,0,1)
You might be well served by perusing the Python tutorial: The Python Tutorial — Python 2.7.9 documentation
Ah, it also occurs to me that you have to prevent Chimera from trying to "smart display" your fake molecule, which will change colors and display. Do that by setting the "noprefs" attribute to True, in analogous fashion to isRealMolecule:
mNACP.noprefs = True
mBCP.noprefs = True
> Same thing happens with the a.radius command.
Really? A NameError? What did that code look like?
--Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20150109/ec63be0d/attachment.html>
More information about the Chimera-dev
mailing list