Difference between revisions of "Rasmolify"

From PyMOLWiki
Jump to navigation Jump to search
(categorized)
Line 53: Line 53:
  
 
</source>
 
</source>
 +
 +
[[Category:Script_Library]]

Revision as of 08:50, 21 February 2008

Here it is! Long awaited, less tested;

Install

Linux
In your ~/.pymolrc set something like the following
 run ~/pymolscripts/rasmolify.py 
Finally, make a directory called ~/pymolscripts and copy the code below into a file called rasmolify.py - That should do the trick. You may also like to add a line that reads
set virtual_trackball, off
in your ~/.pymolrc
Windows
???

Usage

Think 'rasmol'

Code

## This is just a quick hack. For something more meaty see;
## http://arcib.dowling.edu/sbevsl/

## Version 0.0.00-000/0

## TODO: 

## Check if a 'current' selection exists, and perform the action on
## that selection. Make 'off' proper. Add units to the commands that
## take them. Turn off the virtual_trackball. Fix the mouse behaviour.

## spacefill
def spacefill(toggle=1):
    if(toggle==1):
        cmd.show("spheres")
    else:
        cmd.hide("spheres")
cmd.extend("spacefill", spacefill)

## cartoon
def cartoon(toggle=1):
    if(toggle==1):
        cmd.show("cartoon")
    else:
        cmd.hide("cartoon")
cmd.extend("cartoon", cartoon)

## wireframe
def wireframe(toggle=1):
    if(toggle==1):
        cmd.show("lines")
    else:
        cmd.hide("lines")
cmd.extend("wireframe", wireframe)


## exit
def exit():
    cmd.quit()
cmd.extend("exit", exit)