I've tried to link pulldown knobs before in nodes like CheckerBoard using
setExpression() without success.The only way I have ever figured out how to
make this work is through a knobChanged callback. The approach is similar
whether it's a group or gizmo. Here are some examples to try in your
menu.py:
# For a group:
def formatTestCB():
group_name = 'myGroup' # Change this to the name of your group
checkerboard_name = 'CheckerBoard1' # Change this to the name of the
CheckerBoard node inside your group
for g in nuke.allNodes():
if group_name in g.name():
f = g.input(0)['format'].value()
g.begin()
nuke.toNode(checkerboard_name)['format'].setValue(f)
g.end()
nuke.addKnobChanged(formatTestCB)
# Or, if it's a gizmo, you can do:
def formatTestGizmoCB():
gizmo_class = 'myGroup' # Change this to the name of your gizmo
checkerboard_name = 'CheckerBoard1 '# Change this to the name of the
CheckerBoard node inside your gizmo
for g in nuke.allNodes(gizmo_class):
f = g.input(0)['format'].value()
g.begin()
nuke.toNode(checkerboard_name)['format'].setValue(f)
g.end()
nuke.addKnobChanged(formatTestGizmoCB)
###
Seems like you should be able to link pulldowns in all types of nodes (and
for some pulldowns, you can, using the setExpression() method. Anyone know a
better way to do this that doesn't involve a general knobChanged callback?
I'd imagine this might slow things down slightly looping through
nuke.allNodes() on every knobChanged.
-Ean
On Tue, Mar 22, 2011 at 3:35 PM, Ron Ganbar <[email protected]> wrote:
> Hmmm...
> OK, anyone: is there a way to call up in an expression the current format
> of a node? Not the height and width, but the whole format?
>
>
>
> Ron Ganbar
> email: [email protected]
> tel: +44 (0)7968 007 309 [UK]
> +972 (0)54 255 9765 [Israel]
> url: http://ronganbar.wordpress.com/
>
>
>
> On 22 March 2011 17:25, Julian Van Mil <[email protected]> wrote:
>
>> maybe... I know absolutely nothing about python :(
>>
>> That of course, is another problem for me entirely.
>>
>> - jvm
>>
>>
>> On 2011-03-22, at 11:13 , Ron Ganbar wrote:
>>
>> Python button and a callback for onCreate?
>>
>>
>> Ron Ganbar
>> email: [email protected]
>> tel: +44 (0)7968 007 309 [UK]
>> +972 (0)54 255 9765 [Israel]
>> url: http://ronganbar.wordpress.com/
>>
>>
>>
>> On 22 March 2011 17:02, Julian Van Mil <[email protected]> wrote:
>>
>>> thanks for this - I'm doing something similar right now (just with
>>> reformat nodes... and it works), but I'm trying to get the checkerboard to
>>> get drawn initially at the proper res without having to filter it. Any
>>> ideas?
>>>
>>> - jvm
>>>
>>>
>>> On 2011-03-22, at 10:58 , Frank Fieser wrote:
>>>
>>> > This is how I like to do it within my tools...
>>> >
>>> >
>>> > set cut_paste_input [stack 0]
>>> > version 6.1 v2
>>> > CheckerBoard2 {
>>> > inputs 0
>>> > name CheckerBoard1
>>> > selected true
>>> > xpos -625
>>> > ypos -613
>>> > }
>>> > Crop {
>>> > box {0 0 {Gather_Input_Data.myWidth i} {Gather_Input_Data.myHeight i}}
>>> > reformat true
>>> > crop false
>>> > name Crop_Reformat
>>> > selected true
>>> > xpos -625
>>> > ypos -501
>>> > }
>>> > push $cut_paste_input
>>> > Radial {
>>> > area {512 389 1536 1167}
>>> > name Replace_with_Your_Input
>>> > selected true
>>> > xpos -497
>>> > ypos -569
>>> > }
>>> > NoOp {
>>> > name Gather_Input_Data
>>> > selected true
>>> > xpos -497
>>> > ypos -532
>>> > addUserKnob {20 User}
>>> > addUserKnob {7 myWidth}
>>> > myWidth {{input.width i}}
>>> > addUserKnob {7 myHeight}
>>> > myHeight {{input.height i}}
>>> > }
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Tue, Mar 22, 2011 at 6:49 AM, Julian Van Mil
>>> > <[email protected]> wrote:
>>> >> I need to create a checkerboard inside a gizmo or group that inherits
>>> the
>>> >> format of Input1. Anyone know how to do this easily? I know I'm
>>> missing
>>> >> something simple here...
>>> >> Thanks,
>>> >> - jvm
>>> >> _______________________________________________
>>> >> Nuke-users mailing list
>>> >> [email protected]
>>> >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Frank Fieser
>>> > http://www.frankfieser.com
>>> > Compositor, Lighter, Motion Designer
>>> > Los Angeles | 407.963.0710
>>> > _______________________________________________
>>> > Nuke-users mailing list
>>> > [email protected]
>>> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>
>>> _______________________________________________
>>> Nuke-users mailing list
>>> [email protected]
>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>>
>>
>>
>>
>> _______________________________________________
>> Nuke-users mailing list
>> [email protected]
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>
>>
>
> _______________________________________________
> Nuke-users mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
>
_______________________________________________
Nuke-users mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users