and also, in autolabel or expressions this will not work:
[python nuke.thisNode()["size"].getValue()]
but this will work:
[python nuke.thisNode().knob("size").getValue()]
2011/3/8 Alexander Jones <[email protected]>
>
>
> On 8 March 2011 06:19, Ben Dickson <[email protected]> wrote:
>
>> node['blah'].value()
>>
>> ..is less typing, so I use that over the functionally identical
>> node.knob("blah").value()
>>
>
> They're not identical -- ["blah"] will raise a KeyError for a missing knob,
> whereas knob("blah") will return None. Subtle!
>
>
>>
>> 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
>>
>
>
>
> --
> Alexander Jones
> Double Negative R&D
> www.dneg.com
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
--
Michael Havart | DMP-ENV | MPC-London
images: cghub.com <http://mika.cghub.com/> |
blogspot.com<http://michaelhavartportfolio.blogspot.com>
<http://michaelhavartportfolio.blogspot.com>cv: linkedin
profile<http://www.linkedin.com/in/michael0havart>
| imdb <http://www.imdb.com/name/nm3795968/>
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python