Since the FrameRange object is already iterable, how about:

f=nuke.FrameRange( '1-10x2')
for frame in f:
  print frame
else:
  print "done"


On Mon, Feb 28, 2011 at 10:10 PM, 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