Why not just use a for loop?

f = nuke.FrameRange( 1-10x2')
for i in f:
   print i

-Nathan

-----Original Message----- From: Frank Rueter
Sent: Monday, February 28, 2011 10:10 PM
To: Nuke Python discussion
Subject: [Nuke-python] elegant or not?

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