Though this is possibly better code and allows you to select other nodes by
mistake
Howard
def getParentNode(node):
try:
parentNode = node.input(0)
if parentNode.Class() == 'Dot':
if not parentNode['label'].getValue():
return getParentNode(parentNode)
else:
return parentNode
else:
return node['label'].value()
except AttributeError:
nuke.message('No input node')
def dotLabel():
if not nuke.selectedNodes('Dot'):
nuke.message('Please select a dot')
return
else:
nodes= nuke.selectedNodes('Dot')
for i in nodes:
try:
pnlabel=getParentNode(i)['label'].value()
pnLabelSize=getParentNode(i)['note_font_size'].value()
pnLabelColour=getParentNode(i)['note_font_color'].value()
i['label'].setValue(pnlabel)
i['note_font_size'].setValue(pnLabelSize)
i['note_font_color'].setValue(int(pnLabelColour))
except:
pass
>________________________________
> _______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users