Hi :)
You can use for-loops in pml files, but it's a bit tricky. Usually you will
want to enclose the code in a python .. python end block, indicating that
the lines are pure python:
python
for i in range(2,61):
...
python end
Also mind that range runs UP TO (excluding) the last number, so you'll need
to put 61 if you want the counter to run to 60. For cases like this, I tend
to use a trick, so I put the for-loop on one line, and thus avoid the
python block:
filename="C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
imatinib\PyMOL movie\Image%04d.png"
rotate y, -6
for i in range(1,61): cmd.rotate("y",6) or cmd.png(filename%i, dpi=300,
ray=1)
Hope it helps,
Tsjerk
On Tue, Jan 6, 2015 at 4:09 PM, David Hall <li...@cowsandmilk.net> wrote:
> (a) I'll let someone else say whether you can use range in pml files, not
> completely sure on that one and the formatting rules. personally, I would
> write this in python, and you would need a : after the range
>
> (b) you are missing any indication of what %4d refers to. See example 3.23
> on http://www.diveintopython.net/native_data_types/formatting_strings.html
> , you need to have a % i so that there's a variable corresponding to your
> %4d. I also think you want %04d . And again, not sure what the rules are in
> pml files, python is much better documented.
>
> On Tue, Jan 6, 2015 at 9:00 AM, Brenton Horne <brentonho...@ymail.com>
> wrote:
>
>> Hi,
>>
>> I've been executing the pml script I wrote:
>>
>> set ray_opaque_background, 0
>>
>> png C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
>> imatinib\PyMOL movie\Image0001.png, dpi=300, ray=1
>>
>> for i in range(2, 60)
>>
>> rotate y, 6
>>
>> png C:\Users\Brenton\Documents\Chem Structures\PDBs\2\2HYY -
>> imatinib\PyMOL movie\Image%4d.png, dpi=300, ray=1
>>
>>
>> The desired result from this script is a series of 60 transparent pngs
>> taken at 6 degrees apart (rotated around the y axis) with name
>> Image0001.png, Image0002.png, Image0003.png, ..., Image0060.png. Sadly
>> however I only got two PNGs: Image0001.png and Image%4d.png. How do I
>> overcome this problem?
>>
>> Thanks for your time,
>> Brenton
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> 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
>>
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> 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
>
--
Tsjerk A. Wassenaar, Ph.D.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
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