Graphics Programs Reference
In-Depth Information
this is performed inside the toolbar variable. This new menu is also assigned a
variable called userMenu.
You can now run these two commands to create an unpopulated menu.
Note
As mentioned in the beginning of this appendix, Nuke uses different
names for things than the interface itself. In this case, the Python
name “menu” refers to a lot of things, but can refer to a toolbox as
well.IswitchbetweenthenamesdependingonwhetherIwanttode-
scribewhatyou'redoingwhenwritingthecodeorwhatyou'redoing
in the interface.
6. Click the Run Current Script button again.
If you look carefully at your Nodes Toolbar, you will notice you now have a new
toolbox at the bottom with a default icon ( FIGURE I.2 ) .
Figure I.2. A new toolbox is born.
7. Hover your mouse pointer over this new menu and you will see from the pop-up
tooltip that it is called User.
If you click the menu, nothing happens because it's still empty.
Now call up the Gizmo:
8. Click the Previous Script button to bring back the two previous commands.
9. Press Enter/Return to start a new line and enter the next line:
userMenu.addCommand('Safe Areas', "nuke.createNode('SafeAreas')")
10. Click the Run button at the top of the Script Editor to execute this list of com-
mands.
This new command tells Nuke to look for a Gizmo called SafeAreas (in the
second part of the command) and give it the name Safe Areas (note the space).
 
Search WWH ::




Custom Search