Skip to content

Instantly share code, notes, and snippets.

@krets
krets / Nuke: Print Menu
Created April 20, 2014 23:14
Print a given nuke menu
import nuke
def printMenu(menu,indent=0):
if isinstance(menu,basestring):
parts = menu.split("/")
menu = nuke.menu(parts[0])
for i in range(1,len(parts)):
menu = menu.findItem(parts[i])
for x in menu.items():
print "%s%s" % (indent*" ",x.name())
if type(x) == nuke.Menu:
""" I needed some unique icons for numerous pyside scripts. This helped.
"""
from PySide import QtCore, QtGui
import sys
import operator
def getIcon(inputStr='', saturation=.8, value=.9, size=128):
""" Creates a QIcon of a single letter on a solid color based on an input
string. The same string will always produce the same background color.