n['scale'].setSingleValue(False) will split the knob, though the control panel
won’t update from this call alone; calling .setExpression afterward will force
a refresh.
-Nathan
From: Michael Garrett
Sent: Tuesday, February 07, 2012 6:15 PM
To: Nuke Python discussion
Subject: [Nuke-python] knobDefault expression for an XY_KNob?
I want to do something like knobDefault('Defocus.scale.h', '{scale.w*2'}') ,
which doesn't work....
If I do this in the script editor, I found I even need to "nudge" the scale.h
knob first before it will take the expression, but it works (6.3v6 Linux):
n=nuke.selectedNode() # a Defocus
n['scale'].setValue(1,1) # nudge it by forcing a value into the second
tuple value
n['scale'].setExpression('scale.w*2',1) # now add the expression
I assume that if it's really necessary, there is some method for expanding the
tuple value fields of a usually collapsed XY_Knob but I'm not sure what that
would be.
Thanks,
Michael
--------------------------------------------------------------------------------
_______________________________________________
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