n = nuke.createNode('NoOp')
k1 = nuke.Double_Knob('aknob')
k2 = nuke.Tab_Knob('atab')
n.addKnob(k1)
n.addKnob(k2)
k1.setFlag(0)  # Or use n['User'].setFlag(0)  if you know your first Tab
will be called 'User', for example



On Thu, Feb 2, 2012 at 4:58 PM, Michael Garrett <[email protected]>wrote:

> > You could always force a switch back to the main tab by 'touching' any
> knob in the main tab.
>
> I think I'm running up against this problem now.  If I use a Python script
> button to create a node and add a tab (in addition to the usual 'User'
> tab), the node is created with that tab focused - even if I edit a knob
> value on the 'User' tab.  So, I can switch tabs and see the knob value has
> changed, but the 'User' tab doesn't have focus.
>
>
>
>
> On 4 January 2012 14:16, John Vanderbeck <[email protected]>wrote:
>
>> > You could always force a switch back to the main tab by 'touching' any
>> knob in the main tab.
>> Problem I see here is how would I know what tab the user was on if it’s a
>> node with multiple tabs?
>>
>>
>> > However, if you're hiding both your knob and tab anyway, why don't you
>> just add the hidden knob and skip adding the tab altogether?****
>>
>> That was actually the first thing I tried, but if I do that Nuke
>> automatically creates a User tab and makes that visible and sets focus to
>> it.
>>
>> ****
>>
>> ** **
>>
>> ** **
>>
>> *From:* [email protected] [mailto:
>> [email protected]] *On Behalf Of *Ivan
>> Busquets
>> *Sent:* Wednesday, January 04, 2012 5:12 PM
>> *To:* Nuke Python discussion
>> *Subject:* Re: [Nuke-python] Create a knob without the panel changing?***
>> *
>>
>> ** **
>>
>> You could always force a switch back to the main tab by 'touching' any
>> knob in the main tab.
>>
>> node[knob].setFlag(0)  # where 'knob' is a knob in the main tab
>>
>> However, if you're hiding both your knob and tab anyway, why don't you
>> just add the hidden knob and skip adding the tab altogether?
>>
>> ****
>>
>> On Wed, Jan 4, 2012 at 1:38 PM, John Vanderbeck <
>> [email protected]> wrote:****
>>
>> Hey gang,****
>>
>> Is there any way that I can make a new knob and add it to a node through
>> Python, without the UI panel for that node changing? I want the knob
>> addition to be completely transparent to the user.  They shouldn’t even
>> know it is happening.  I’m currently doing this:****
>>
>>                 tab = nuke.Tab_Knob('fac', 'fac')****
>>
>>                 tab.setVisible(False)****
>>
>>                 tab.setFlag(0x0000000000000400)****
>>
>>                 thisNode.addKnob(tab)****
>>
>>                 knob = nuke.String_Knob('oldName', 'oldName')****
>>
>>                 knob.setVisible(False)****
>>
>>                 knob.setValue(node_name)****
>>
>>                 thisNode.addKnob(knob)****
>>
>> Which works, but the UI changes tabs when this happens.****
>>
>> John Vanderbeck****
>>
>> Technical Artist****
>>
>> Digital Domain Media Group****
>>
>> NOTICE: This communication may contain privileged or other confidential
>> information. If you have received it in error, please advise the sender by
>> reply email and immediately delete the message and any attachments without
>> copying or disclosing the contents. Thank you. ****
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
> _______________________________________________
> 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