Unless I'm missing something, for sake of completeness, John's answer would have to be wrapped in a function and the 'ret' variable would have be returned.
You could just use this line directly in the expression: nuke.Root()['first_frame'].value()==nuke.frame() or nuke.Root()['last_frame'].value()==nuke.frame() On Thu, Jan 30, 2014 at 11:39 AM, John Stewart <[email protected]> wrote: > 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 [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 > >
_______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
