If you use setName then you can set the label right ?
import nuke
read_node = nuke.nodes.Read(file = '/tm/user/some/folder/snapshot#.png')
read_node.setSelected(True)
a = nuke.selectedNode()['file'].value().split('/')[4]
read_node.setName("%s" % a)
On Thu, Jul 19, 2012 at 10:21 AM, RP <[email protected]>wrote:
> **
> Hello all,
>
> I'm sure you've heard it here a million times already, but I'm a complete
> python newbie in desperate need of help
>
> I am trying to create a read node that has a label taken from the 13th
> directory from its path name.
>
> I can get it to print the name of the 13th directory using
>
> a = nuke.selectedNode()['file'].value().split('/')[13]
> print a
>
>
> but I cant seem to implement this into the label of a read node
>
> Any clues?
> RP
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
--
--:: Kurian ::--
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python