> From: Byron DeLaBarre [mailto:[email protected]]
> Subject: [PyMOL] color association with state?
> Do any pymolers out there know how to associate the color of
> a single object
> with its state?
Sorry, this can't be done with the current versions -- colors are either atomic
or whole-object properties (with a couple of minor exceptions). The only way
around this right now is to distribute the states you want to show over a set
of objects with different colors:
isomesh m1,map1,1.0,state=1
isomesh m2,map2,1.0,state=2
isomesh m3,map3,1.0,state=3
color red,m1
color blue,m2
color green,m3
> I have a multi-state map that I want to color as it moves through the
> different states in a movie. I want the colors to be associated with
> specific states. I only know how to color the entire
> collection of states a
> single color. (something like: color = red, object)
> Alternatively, how could I associate a number of text objects
> (you can do
> those in pymol, right?) with individual states within the
> collection of
> states.
Text objects are brand new, and can only be built right now using compiled
graphics objects (CGOs).
CGOs are always associated with specific states, so adding a label which
changes during the course of a movie would be straightforward, except that text
objects are completely undocumented. Here is a start:
# REQUIRES PyMOL 0.80
# save as cgo_3Dtext01.py
from pymol import cmd
from pymol.cgo import *
from pymol.vfont import plain
cgo = []
axes = [[2.0,0.0,0.0],[0.0,2.0,0.0],[0.0,0.0,2.0]]
pos = [0.0,0.0,0.0]
wire_text(cgo,plain,pos,'Hello World',axes)
pos = [0.0,-3.0,0.0]
cyl_text(cgo,plain,pos,'Hello Universe',0.10,axes=axes)
cmd.set("cgo_line_radius",0.03)
cmd.load_cgo(cgo,'txt')
cmd.zoom("all",2.0)
- Warren
mailto:[email protected]
Warren L. DeLano, Ph.D.