Hi Paula,

* Paula Salgado <pa...@strubi.ox.ac.uk> [2005-04-27 10:44] wrote:
> Hi,
> 
> Is it possible to save an r3d file in pymol for exporting into other 
> render programs like povray? I would like to test rendering in other 
> programs...

I use the following script to save an input file for povray:


#---------------------- save as make_pov.py ----------------
# make_pov.py                                                                   
                    

from pymol import cmd

def make_pov(file):
  """
  Do "run make_pov.py" from within pymol and then execute the script            
                    
  with "make_pov povray.inp" to create the povray.inp file.                     
                 
 
  make note of the dimensions written out by this script and use the
  same (or the same ratio) within povray:
  e.g. output (the "vol" lines only appear if spheres are present):
                                                                                
                    
   PyMOL>make_pov('povray.inp')
    RayRenderPOV: w 1100 h 900 f   63.349 b  102.310
    RayRenderPOV: vol  -17.316   17.316  -14.168
    RayRenderPOV: vol   14.168   63.349  102.310
    RayRenderPovRay: processed 714 graphics primitives.
    Ray: total time: 0.03 sec. = 123885.9 frames/hour. (0.03 sec. accum.)
 
  So for example, you would run povray with:
    povray +Ipovray.inp +W1100 +H900
  or
    povray +Ipovray.inp +W550 +H450
  """
  (header,data) = cmd.get_povray()
  povfile=open(file,'w')
  povfile.write(header)
  povfile.write(data)
  povfile.close()

cmd.extend('make_pov',make_pov)
#---------------------- end of make_pov.py ----------------

All the stuff between the """'s is just instructional comment.

Save this script as a file and do "run make_pov.py" from the PyMOL
command line, then you can type "make_pov povray.inp" to create the
povray.inp file.

Cheers,
Rob
-- 
Robert L. Campbell, Ph.D.                         <r...@post.queensu.ca>
Senior Research Associate                            phone: 613-533-6821
Dept. of Biochemistry, Queen's University,             fax: 613-533-2497
Kingston, ON K7L 3N6  Canada       http://adelie.biochem.queensu.ca/~rlc
    PGP Fingerprint: 9B49 3D3F A489 05DC B35C  8E33 F238 A8F5 F635 C0E2

Reply via email to