Hi Dd H -

`cmd.set` is the wrong command to use here.  (It's for changing settings, not 
for going through states, although some settings can be applied to only a 
specific state).

Instead, you should use `cmd.frame(i)` to move to that frame (state) number.

Note that the `width` and `height` arguments to 
`cmd.png<http://pymolwiki.org/index.php/Png>` are in pixels unless you include 
a unit suffix like '10in' or '10cm', and it also takes a `ray` keyword argument 
if you want to ray trace for a nicer image.  Also, this is in a PyMOL (.pml) 
script instead of a Python (.py) script, you need to enclose any statement that 
requires multiple lines (i.e. loops, if/else, etc.) within a `python` block.

```
python
for i in range(1, cmd.count_states()+1):
     cmd.frame(i)
     cmd.png("%d.png" % (i), width='10in', height='10in', dpi=300, ray=1)
python end
```

Hope that helps.

Cheers,
Jared


On Aug 14, 2016, at 9:48 AM, Dd H <ddhe...@gmail.com<mailto:ddhe...@gmail.com>> 
wrote:

Hi everyone,
I want to render images of frames of my trajectory that loaded in pymol with 
the script below. After running this script, pymol outputs images and they are 
all the same. So what's wrong with my script?

for i in range(1, cmd.count_states()+1):
     cmd.set("state", i, "traj")
     cmd.png("%d.png" % (i), width=10, height=10, dpi=300)

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. 
http://sdm.link/zohodev2dev_______________________________________________
PyMOL-users mailing list 
(PyMOL-users@lists.sourceforge.net<mailto: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

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
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

Reply via email to