during the early beta of v5 we asked for the node objects to return a
dictionary to be able to do just this, so do use it! ;)
On Mar 8, 2011, at 7:24 PM, Nathan Rusch wrote:
> I prefer the dictionary-style knob subscription as well, even if it may be
> less Pythonic in the purest sense.
>
> -Nathan
>
>
> -----Original Message----- From: Ben Dickson
> Sent: Monday, March 07, 2011 10:19 PM
> To: Nuke Python discussion
> Subject: Re: [Nuke-python] knob syntax
>
> node['blah'].value()
>
> ..is less typing, so I use that over the functionally identical
> node.knob("blah").value()
>
> I use node.knobs() occasionally to iterate over all knobs (or use
> node.knobs().keys() )
>
> Incidentally I use [''] over [""], because the first can be typed
> without shift (on UK/Australian keyboards anyway) - same with ("") which
> can be typed with shift held. Efficiency!...
>
> John RA Benson wrote:
>> Hey there -
>>
>> Basic question:
>>
>> just curious - if find myself flipping between using syntax like:
>>
>> node.knob('myknob').value()
>> vs:
>> node['myknob'].value()
>>
>> Is there any 'best practices' or preferred way to write that? Sort of like,
>> do you always use '"' or "'" for quotes...
>>
>> Cheers
>> JRAB_______________________________________________
>> Nuke-python mailing list
>> [email protected]
>> 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://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python