Forget it - I'm being thick - as I am now selecting everything first I should
only ask for greater/less than.
doh!
Howard
>________________________________
> From: Howard Jones <[email protected]>
>To: Nuke Python discussion <[email protected]>
>Sent: Friday, 23 March 2012, 17:55
>Subject: [Nuke-python] Select nodes in same position
>
>
>Hi
>
>
>I've written the below to select all connected nodes above, below, left or
>right of the selected node.
>Could anyone tell me why this wont select nodes that are equal to the xpos or
>ypos.
>
>Before I used nuke.selectConnectedNodes() it worked but now only seems to
>select greater than even though I'm asking '>='
>
>
>Thanks
>
>H
>
>
>
>def selectUpDown(direction):
> sn = nuke.selectedNode()
> nuke.selectConnectedNodes()
> for i in nuke.selectedNodes():
> if 'up'==direction:
> if i['ypos'].value() >=
sn['ypos'].value():
> i['selected'].setValue(False)
> elif 'down'==direction:
> if i['ypos'].value() <= sn['ypos'].value():
> i['selected'].setValue(False)
> elif 'left'==direction:
> if i['xpos'].value() >= sn['xpos'].value():
> i['selected'].setValue(False)
> elif 'right'==direction:
> if i['xpos'].value() <=
sn['xpos'].value():
> i['selected'].setValue(False)
>
>
> sn['selected'].setValue(True)
>
>##########---- via menu.py--------##################
>selectUpDown('right')
>
>_______________________________________________
>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