Skip to content

Instantly share code, notes, and snippets.

@krets
Created April 20, 2014 23:14
Show Gist options
  • Save krets/11127705 to your computer and use it in GitHub Desktop.
Save krets/11127705 to your computer and use it in GitHub Desktop.
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:
printMenu(x,indent+1)
printMenu("Nuke/Test Menu")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment