The nuke.expression evaluates $gui once, then returns a 1 or 0 (true or
false). The you are setting the disable node to that "1" or "0".
Instead I guess you want to use the setExpression method on the disable
knob. This is like right-clicking disable, and clicking "add expression"
Also, you can find certain node classes with
nuke.allNodes("TheNodeClass"), which will work even if you change the
nodes name to something
So, something like:
for node in nuke.allNodes("Blur"):
node.setExpression("$gui")
On 16/02/12 16:17, vfx2be wrote:
> hi,
>
> I'm a beginner at coding so I tried this :
>
> *Code:*
> import nuke
> exp = nuke.expression('($gui)')
> myblurNode = nuke.toNode( 'Blur1' )
>
> for i in nuke.allNodes():
>
>
> if i.name().startswith('Blur'):
> myblurNode["disable"].setValue(exp)
>
>
>
> Works, for the Blur1 of course, but I don't know how to iterate for
> Blur2, 3, etc...
>
> By the way, as you can see, I am not really trying to set Disable at 1
> but at $gui. For some unknow reason, that set it a 1 instead of adding
> the expression $gui .. Any clue ?
>
> Thanks a lot !!
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--
ben dickson
2D TD | [email protected]
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python