How to add hidden plugins to the Toolbar

Sometimes we need -or want- to add a hidden plugin to the toolbar instead of calling it every time we need it. In order to do this we can call it from start by writing some python in the menu.py

In my case, I want to have Blocky -which is similar to Mosaic in After Effects- loaded from start and this doesn’t come as default so I’ve written down this:

nuke.load('Blocky')
m = nuke.toolbar("Nodes")
m.addCommand('Filter/Blocky', 'nuke.createNode("Blocky")', icon='CheckerBoard.png')

In this case I’ve put it inside the Filter Menu -as I consider it a filter- and I’ve assigned the icon of the CheckerBoard node to it as it feels ‘blocky’. We can choose another icon from another existing node just by writing the exact name of it or choose one of our own by specifying the path and loading it before in the init.py file.

Another sample: I would like to include FieldSelect -to select the field- to the Image menu so:

nuke.load('FieldSelect')
m = nuke.toolbar("Nodes")
m.addCommand('Image/FieldSelect', 'nuke.createNode("FieldSelect")', icon='Merge.png')

References:
https://www.thefoundry.co.uk/products/nuke/developers/63/pythondevguide/custom_ui.html
No Comments

Post A Comment