zip it like this

colors = [‘red’,’blue’]
fetch 1nmr, discrete=1, async=0
as ribbon
set all_states
for color, model in zip(range(cmd.count_states()),colors): cmd.color(str(color), "state %s" % x)
On Nov 12, 2013, at 11:32 PM, Jerome BENOIT <g6299304p@rezozer.net> wrote:

Hello Jason,

thanks for your hint.

Unfortunately, I can not produce what I want:

Let assume that I read a local PDB file with different MODELS and
I would like to colour the first model in red, the senond in blue:
what would be the MPL script coaamnd ?

Thanks in advance,
Jerome

On 11/11/13 19:17, Jason Vertrees wrote:
Hi Jerome,

fetch 1nmr, discrete=1, async=0
as ribbon
set all_states
for x in range(cmd.count_states()): cmd.color(str(x), "state %s" % x)

You can substitute the spectrum command for the color command.

Cheers,

--- Jason

On Sat, Nov 9, 2013 at 8:54 PM, Jerome BENOIT <g6299304p@rezozer.net> wrote:
Hello List,

is there a way in PML script to apply a specific spectrum to each MODEL (as define in PDB data file) ?

Thanks in advance,
Jerome

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net




------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net