Great! I was just getting to thisKnob in the docs.

Many thanks

Howard





________________________________
From: Michael Havart <[email protected]>
To: Nuke Python discussion <[email protected]>
Sent: Tue, 15 March, 2011 13:58:16
Subject: Re: [Nuke-python] equivalent of a 3-way radio button

sorry I mean:

if nuke.thisKnob().name() == 'A' and nuke.thisKnob().value() != '-':
   n[  'B'].setValue(0)





2011/3/15 Michael Havart <[email protected]>

I think you're looking for:
>
>if nuke.thisKnob() == 'A' and n['A'].value() != '-':
>      n[  'B'].setValue(0)
>   ...
>
>
>hope that helps
>
>
>
>
>
>2011/3/15 Howard Jones <[email protected]>
>
>Hi
>>
>>I'm wanting to write a 3-way radio button sort of thing.
>>
>>I have 3 pulldowns (with lots of options) and through knob changed I'd like 
>>to 
>>pick up which one has been touched and set the other 2 to a null setting 
>>('-'),
>>so that only one knob can be active at any time. No doubt very basic but I'm 
>>stuck (again).
>>
>>This test code will always (of course) set the others based on A unless I 
>>manually change A to '-' first then change the others. But I'd like which 
>>ever 
>>knob was changed to set the others.
>>Is there some logic that can do this or am I into saving the previous states 
>>and 
>>comparing the difference. At first glance it looks like a 3-way switch but 
>>I'm 
>>not sure it is.
>>
>>n=nuke.selectedNode()
>>if n['A'].value() != '-':
>>    n[  'B'].setValue(0)
>>    n['C'].setValue(0)
>>elif n['B'].value() != '-':
>>    n[ 'A'].setValue(0)
>>    n['C'].setValue(0)
>>elif n['C'].value() != '-':
>>    n[ 'A'].setValue(0)
>>    n['B'].setValue(0)
>>
>>
>>
>>
>>Any help greatly appreciated.
>>  
>>Howard
>>_______________________________________________
>>Nuke-python mailing list
>>
>>[email protected]
>>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>>
>>
>


-- 

 Michael Havart | DMP-ENV | MPC-London 
images: cghub.com | blogspot.com
cv: linkedin profile | imdb
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to