Untested, but is there a reason you can't use

for frame in nuke.FrameRange(...):
    print frame

For loops are designed to stop at StopIteration exceptions, IIRC.

Cheers,
Xav


On 1 March 2011 16:10, Frank Rueter <[email protected]> wrote:

> I'm a bit brain dead, sorry:
>
> I would like to iterate over all frames in a FrameRange object and thought
> x.next() would be the ticket.
> How would you use this in the most elegant way though?
>
> I tried an infinite loop like this:
>
> f=nuke.FrameRange( 1-10x2')
> while True:
>        try:
>                print f.next()
>        except StopIteration:
>                print 'done'
>                break
>
>
> Somehow this doesn't strike me as the most elegant way. maybe it is?
>
> Cheers,
> frank
>
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to