Shortcut Editor v1.1


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Ben Dickson
Allows you to quickly bind keyboard shortcuts to existing menu items without writing Python code
Requirements:
8.0, 7.1, 7.0 or later
22 Oct 2016
1214

watch the video Tool Video

Nuke shortcut editor

shortcuteditor is a keyboard shortcut editor for The Foundry's Nuke

It allows you to quickly bind keyboard shortcuts to existing menu items without writing Python code

tabtabtab

Installation

Put shortcuteditor.py on PYTHONPATH or NUKE_PATH somewhere (probably in ~/.nuke/)

mkdir -p ~/.nuke
cd ~/.nuke
curl -O https://raw.github.com/dbr/shortcuteditor-nuke/master/shortcuteditor.py

Then in ~/.nuke/menu.py add the following:

try:
    import shortcuteditor
    shortcuteditor.nuke_setup()
except Exception:
    import traceback
    traceback.print_exc()

Notes

Should work in Nuke 6.3v3 onwards (when the nuke.Menu.setShortcut method was added)

The shortcuts overrides are saved in ~/.nuke/shortcuteditor_settings.json

You can search for menu items either by name ('Search by text'), or by existing shortcut ('Search by key'), or both (rarely necessary)

There are a few shortcuts you cannot (easily) override in the viewer context, specifically things like the r/g/b and z/x/c shortcuts are hardwired (as of Nuke 7 - might change in the future)

If you are changing an existing shortcut, be sure to clear the old usage of the key (using the 'Search by key')

Future improvements

  • Handle conflicting shortcuts better (highlight the shortcut in red when it conflicts or something?)
  • Ability to view/clear specific overrides, rather than global 'Reset..'

Change log

  • v1.0
    • Initial version
  • v1.1
    • Fixed error in error handling when a shortcut is added for a menu item which disappers.
    • nuke_setup method works as expected when installed earlier in NUKE_PATH. Previously it might run before some menu items were added, so the shortcut was never set.
GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
Please login in order to download these files.

Comments   

 
# Romain HUBERT 2015-02-25 19:50
Really nice!! Thx
 
 
# li zhaohui 2015-03-03 11:01
nuke8 use shortcuteditor. py wrong, do not display the default and custom shortcut keys shortcut
 
 
# Maxime Lemieux 2015-05-06 18:08
Really useful. Thank you for the share
 
 
# li zhaohui 2015-08-07 10:33
My nuke8 and nuke9 can't display the shortcut keys that have been set up, but it's possible to be in nuke7.I see Nukepedia Tools Useful 01 of the video is possible, ask the question out there?
 
 
# Jason Huang 2015-08-07 16:25
I saw the nukepedia video and gave it try in Nuke 9v3.
Got an error:

File "C:/Users/xxx/. nuke/nuke.scrip ts\shortcutedit or.py", line 4
 
 
# Frank Rueter 2015-08-07 20:43
I'm guessing it's because you are using a dot in a directory name.
 
 
# Jason Huang 2015-08-07 20:59
Quoting Frank Rueter:
I'm guessing it's because you are using a dot in a directory name.

You rock, Frank! Changed the dot to underscore and volia....

Thanks!!
 
 
# Jason Huang 2015-08-07 22:44
When I use the script, I don't see any of the current hotkey (default ones or added in menu.py) shown up in the editor.
I am on Nuke 9.0v3, Win 7 x64 Ultimate.
 
 
# Thomas Vu 2015-12-31 15:59
can you help me install this script on NUKE 9

after copy that script to C:\Program Files\Nuke9.0v8\plugins\nukescripts

and put that code to menu.py
then i got this error

Quote:
NukeX 9.0v8, 64 bit, built Oct 26 2015.
Copyright (c) 2015 The Foundry Visionmongers Ltd. All Rights Reserved.
File "C:/Program Files/Nuke9.0v8/plugins/menu.py", line 39
shortcuteditor.nuke_setup()
^
IndentationError: unexpected indent
how to fix this ?
 
 
# Frank Rueter 2015-12-31 22:51
Presumabli there are mismatching indentations in that file (indentations are part of the syntax in Python.
Btw, you are better off creating a new menu.py file in your $HOME/.nuke directory so you have better control over those things. Also, the custom stuff will work with all versions of Nuke that way.
 
 
# Thomas Vu 2016-01-01 11:03
thank you Mr Frank for reply. But can you help me abit more, i searched every where to use this script but no help. im new to use nuke,i had been usually used on other software, then i got some trouble with keyboard shortcut on nuke.

So again. im using Window
step1:
Quote:
mkdir -p ~/.nuke
cd ~/.nuke
curl -O https://raw.github.com/dbr/shortcuteditor-nuke/master/shortcuteditor.py

this command for create the folder ".nuke" and copy that script inside. DONE
step2: edit "menu.py" i put this Quote:
import shortcuteditor
shortcuteditor.nuke_setup()
except Exception:
import traceback
traceback.print_exc()
to below of some group import in menu.py

then i got this error
Quote:
File "C:/Program Files/Nuke9.0v8/plugins/menu.py", line 32
import shortcuteditor
^
IndentationError: unexpected indent
... i dont know how to fix this
 
 
+1 # Wouter Gilsing 2016-01-01 22:15
You got an identation error. Looks like you lost all the blank spaces in you copied menu.py code (and the 'try:' as well). Just make sure you don't lose the spaces and it should be fine. Otherwise Python won't know where your 'try' and 'exception' will begin and end.

Maybe check this out if you're interested:
https://docs.python.org/2/reference/lexical_analysis.html#indentation
 
 
+1 # Frank Rueter 2016-01-01 23:29
What Wouter said. The code should probably look like this:
check the documentation at the top of the page and make sure you keep white spaces and don't lose the "try".
And again, I'd strongly suggest to create a new menu.py file in your $HOME/.nuke directory rather than modifying tyhe one in tuke'sinstall directory.
 
 
# Thomas Vu 2016-01-02 02:49
solved. thank you Mr Wouter and Mr Frank.

my bad i missed that damn "try:" word like Mr Wouter said
after that still got some trouble with the UI, so followed Mr Frank advice i rebuild the menu by copy group by group from old menu to new menu, and find it out where is the trouble, FINALLY ITS DONE , THANK YOU AGAIN ^^ and Happy New Year Mr Frank and Mr Wouter

P/s: One more thing, i want to use "Space" key for pan and hold replace "Alt" key. Do you guys know how to change it ?
 
 
# li zhaohui 2016-03-29 16:02
Is there a nuke8 or 9 can be used normally? If you can send my mailbox? thank you
[email protected]
 
 
# li zhaohui 2016-03-04 12:13
Can give me a nuke9 under the use with the shortcut keys to show.thank you. [email protected]
 
 
# Max Last 2017-02-03 15:04
Very useful, thank you!

By the way, the link to the github repo is missing a colon after the https

:)
 
 
# Erwan Leroy 2017-07-14 18:45
Hi Ben.
Is there any plans to update with shortcutContext support? It would be great.
 
 
# li zhaohui 2017-08-01 01:53
shortcuteditor nuke 11 Inoperation
 
 
+2 # li zhaohui 2017-10-11 15:13
Can someone provide a version that nuke11 can use?
 
 
+1 # kelsey napier 2017-10-30 23:55
Agreed. Would love to use it in nuke11 as well. Thanks!
 
 
+1 # Michael Clemens 2018-02-16 01:39
+1 Nuke 11
 
 
# Michael Clemens 2018-06-13 19:06
+2!!!!
 
 
# Erwan Leroy 2018-06-13 23:29
If you check the GitLab Link, I have made a pull request for the Nuke 11 version. You can download it. It does also require to get Qt.py (see nukepedia home page)
 
 
# li zhaohui 2018-06-19 03:06
No update
 
 
# Erwan Leroy 2018-06-19 03:13
You can get my version here: https://github.com/herronelou/shortcuteditor-nuke

If you only use in 11 and don't need backwards compatibility you can replace "from Qt import ..." with "from PySide2 import ..." So you don't have to install Qt.
 
 
# li zhaohui 2018-06-19 17:46
Do not know why, do not display in shotcut, the current shortcut key settings!
 
 
# li zhaohui 2018-09-19 20:05
The shortcut keys for the default settings are not displayed.
 
 
# iden yang 2018-08-02 08:40
I am quite addicted to this great tool. But I'm having some trouble in getting it to work with Nuke 11. Below is what I did using version 1.2 from GITLab. The console said the 'QtWidgets' is not defined.

from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidge ts import *
# Qt
#from Qt import QtCore, QtWidgets, QtGui
#from Qt.QtCore import Qt
 
 
# iden yang 2018-08-02 09:24
Sorry, I found where is my mistake
I changed to these, it's working now

import PySide2
from PySide2 import QtWidgets,QtCore,QtGui

Sorry~ I am new to Python :lol:
 
 
# K P 2018-10-13 07:28
Great tool!

Would be great if work in Nuke 10.5 as well :D

Cheers everyone.
 
 
# Peter Johnson 2018-10-29 12:00
Hi, is the Shortcut Editor v1.1 valid for Nuke 11.2v4?
Best,
Peter
 

You have no rights to post comments

We have 3256 guests and 54 members online