On 08/13/2014 06:35 PM, [email protected] wrote:
> I'm sure this is trivial, but I'm obviously missing something simple!
>
> I have 2 buttons; 1 to colour my model blue, and 1 to reset the colours:
>
> Jmol.jmolButton(jmol, "select model=1.1; color blue","button1")
> Jmol.jmolButton(jmol, "select model=1.1; set defaultColors Jmol","button2")
>
> ...but the second button doesn't change the colours back!
>
> I've also tried variations:
>
> Jmol.jmolButton(jmol, "set defaultColors Jmol; color model=1.1","button2")
> Jmol.jmolButton(jmol, "select atoms; set defaultColors Jmol","button1")
>
> etc etc, but none work. What have I done wrong?!
>
The two commands have different intentions.

The first command "color blue" changes the rendering color of the 
currently selected atoms. Different rendering types like "spacefill", 
"wireframe", "cartoon" will all get the same color unless the color was 
changed individually (e.g.: "color cartoon red").
By default atom renderings are colored according to the atom type.
To restore this you can use the command "color cpk".
By "cpk" Jmol colors atom renderings by the atom type. The command 
"color chain" will color them by the chain they are assigned to.

The sets of colors used for atom types are called 'color schemes'. And 
this is where the second command "set defaultColors Jmol" plays a role.
In Jmol there exist several atom color schemes (e.g.: jmol, rasmol; see 
"http://jmol.sourceforge.net/jscolors/";). With "set defaultColors" you 
select between these schemes.
In your case you couldn't see any difference because the default atom 
color scheme is already 'jmol'.

Please look at the Jmol scripting documentation for more details:
http://jena3d.fli-leibniz.de/doc/jmol_scripting/index.htm?&fullmanual=1&ver=14.2#color

Regards,
Rolf
-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  [email protected]
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to