This repository has been archived by the owner on Oct 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
menu.py
49 lines (37 loc) · 2.02 KB
/
menu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import S_Utils
# Eliminates the frustration of 10 panels, defaults to 2
nuke.toNode('preferences')['maxPanels'].setValue(5)
# expand properties bin when node selected, otherwise collapse
nuke.toNode('preferences')['ExpandSelection'].setValue(True)
# nuke.addFavoriteDir("User Settings", "C:/Users/sntshk/.nuke/", nuke.PYTHON)
# this is the top nuke menubar
nukemenu = nuke.menu('Nuke')
# adds custom item in existing menu
nukemenu.findItem('File').addCommand('Restart Nuke', 'S_Utils.restartNuke()', "ctrl+shift+q", index=-1, shortcutContext=1)
# Nuke's Node menu
nodemenu = nuke.menu("Nodes")
# nodemenu.addCommand("Channel/Shuffle", 'nuke.createNode("Shuffle")', "n", shortcutContext=2, icon='Shuffle.png')
# https://support.foundry.com/hc/en-us/articles/208720909-Q100118-Setting-custom-keyboard-shortcuts-in-Nuke-9-and-10
nodemenu.findItem('Channel/Shuffle').setShortcut('n')
# Santosh Menubar
SantoshMenu = menubar.addMenu("S_Scriptlets")
SantoshMenu.addCommand("Create/R from W", "S_Utils.create_read_from_write()", "alt+j")
SantoshMenu.addCommand("Select", "S_Utils.select(nuke.getInput('Which nodes to select?', 'Read'))")
# Santosh inside Toolbar; this is for gizmos
toolbar = nuke.menu('Nodes')
S_Nodes_Menu = toolbar.addMenu('$antoshTools', icon='S_Santosh.png')
S_Nodes_Menu.addCommand('S_Trails', 'nuke.createNode("S_Trails")', 'alt+shift+t', icon='S_Trails.png')
S_Nodes_Menu.addCommand('S_FrequencySep', 'nuke.createNode("S_FrequencySep")', icon='S_FrequencySep.png')
# NODES CUSTOMIZATONS
#################################
# Shuffle label be the input of first "in" value
nuke.knobDefault("Shuffle.label", "[knob in]")
# Project Settings > Default format: HD 1920x1080
nuke.knobDefault("Root.format", "HD_1080")
# Sets the bounding box to B instead of A and B combined
# See https://twitter.com/sntshk/status/877413861254725635
nuke.knobDefault("Merge.bbox", "3")
#################################
# REMEMBER: USING CANCEL BUTTON IS REDUNDANT IN UI DESIGN