Cool. Thank you Nathan.

A while back, I was looking for a way to get back the Link_Knob object,
precisely for this reason.

Always faced the problem of the object resolving to the target knob. It's
great to know that the Link_knob object can be reached that way.

Thanks for sharing.


On Thu, Aug 18, 2011 at 11:53 AM, Nathan Rusch <[email protected]>wrote:

> Sending this one to the list for posterity, since I'm currently talking to
> you on IRC.
>
> In order to hide the knob on the container node, you have to call
> .setVisible(False) on the Link_Knob object itself. The tricky part about
> this is that trying to grab a Link_Knob using <node>.knob('render_views') or
> the knob name subscription syntax will cause the Link_Knob to resolve to its
> target.
>
> Instead, use <node>.knobs()['render_views']**. This gets you the "pointer"
> knob, which can be shown/hidden separately from the target, and since that's
> what actually "exists" on your Group, the visibility behavior will behave
> correctly.
>
> -Nathan
>
>
> -----Original Message----- From: Hugh Macdonald
> Sent: Thursday, August 18, 2011 11:01 AM
> To: Nuke Python discussion
> Subject: [Nuke-python] Hiding/showing linked knobs in gizmos
>
>
> Hi,
>
> I've got a Render Gizmo here that has a disabled Write node inside it.
> I'm using this Write node to access certain internal functionalities of
> the Write node, including creating link knobs for both Format and
> ColourSpace.
>
> The other knob that I'm linking is Views. However, with this knob, I
> want to hide/show it based on other knobs in my Gizmo.
>
> I've called my linked knob "render_views":
>
>  addUserKnob {41 render_views l Views T Write1.views}
>
> I don't seem to be able to hide this knob, by either hiding the knob on
> my Gizmo or by hiding the knob it's linked to.
>
> I've tried both of the following methods:
>
>    n['render_views'].setVisible(**False)
>
> and
>
>    with n:
>        w = nuke.toNode("Write1")
>        w['views'].setVisible(False)
>
>
> Any idea how I can do this?
>
> I did try adding a MultiView_Knob to my node, but this didn't serialize
> out properly - it ended up in the gizmo as:
>
>  addUserKnob {0 render_views l Views}
>
> Any ideas?
>
> Cheers
>
> Hugh
>
> ______________________________**_________________
> Nuke-python mailing list
> Nuke-python@support.**thefoundry.co.uk<[email protected]>,
> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-python<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python>
> ______________________________**_________________
> Nuke-python mailing list
> Nuke-python@support.**thefoundry.co.uk<[email protected]>,
> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-python<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