I think this is related to the question about view setting. I rewrote the png
command (see below) to simultaneously output my image, but also output the
entire matrix and viewport with same name as the image but with filetype .vew.
That file can then be run with “@“ to recall the view. The output file also
contains the name of the .pse file. If one wants this per scene rather than
image, I assume one can rewrite the scene command too.
from pymol import cmd
import os
import re
import string
# import selector
def __init__(self):
cmd.extend('png',mypng)
def mypng(fname, quiet=1):
r = 1
format = 'vew'
cmd.png(fname, dpi=300, quiet=0)
sname = fname
if re.search("\.png$",fname):
fname = re.sub("\.png$","",fname)
fname = fname + ".vew"
fname = os.path.expanduser(fname)
fname = os.path.expandvars(fname)
f=open(fname,"w")
st=cmd.get("session_file")
f.write("#Session file: " + st + "\n")
f.write("#View matrix for " + sname + ".png" + "\n")
st = cmd.get_view(output=3)
f.write(st)
f.write("#Viewport when rendered:" + "\n")
st=cmd.get_viewport(output=3)
f.write(st)
f.close()
return r
cmd.extend('png',mypng)
_______________________________________________
Mark A. Saper, Ph.D.
Associate Professor of Biological Chemistry, U-M Medical School
Room 3220B, MSRB III sa...@umich.edu +1 (734) 764-3353
On Mar 7, 2016, at 1:26 PM, pymol-users-requ...@lists.sourceforge.net wrote:
> Re: [PyMOL] How to store matrix settings for individual scenes?
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
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