This should do the trick.

first = nuke.Root()['first_frame'].value()

last = nuke.Root()['last_frame'].value()

frame = nuke.frame()

if frame in [first, last]:

ret = 1

else:

ret = 0




Jason P Nguyen wrote:
Hi all,
Anyone knows an expression to to switch in the switch node from 0 to 1 on 1st & last frame? let's just say I want the switch node to be 1 at 1st & last frame & 0 for the rest of the seq.
I tried first_frame!=1 but it doesn't switch.

Thanks in advance,

*Jason Phong Nguyen*
/Visual Effects Composito/r

(310) 893-3455

www.jasonpnguyen.com <http://jasonpnguyen.com/>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to