Shortcut Editor v1.3


 
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:
13.1, 12.2, 12.1, 12.0, 11.3, 11.2, 11.1, 11.0, 10 or later
Linux, Mac, Windows
17 Aug 2021
3009

Nuke shortcut editor

shortcuteditor is a keyboard shortcut editor for Foundry's Nuke

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

tabtabtab

Watch the first episode of Lars Wemmje's 'Useful Nuke Tools' for more details!

Installation

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

mkdir -p ~/.nuke
cd ~/.nuke
curl -O https://raw.githubusercontent.com/dbr/shortcuteditor-nuke/v1.3/shortcuteditor.py

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

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

Notes

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.

If you are changing an existing shortcut, be sure to clear the old usage of the key. A popup appears to help with this if adding conflicting shortcuts.

Future improvements

For a list of requested and planned features, see the project's issue tracker on GitHub, https://github.com/dbr/shortcuteditor-nuke/issues

Change log

  • v1.3 - 2021-08-10

    • Small fixes to support Nuke 13
  • v1.2 - 2020-08-12

    • Updated to support Nuke 11 and 12.
    • Warns when overriding an existing shortcut (PR #12 by herronelou)
    • Added button to export the key-overrides as a Python snippet.
    • Faster UI update for searching
  • v1.1 - 2014-08-23

  • Fixed error in error handling when a shortcut is added for a menu item which disappears.

  • 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.

  • v1.0 - 2013-10-09

  • Initial version

GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
Please login in order to download these files.

Comments   

 
0 # Romain HUBERT 2015-02-25 19:50
Really nice!! Thx
 
 
0 # li zhaohui 2015-03-03 11:01
nuke8 use shortcuteditor. py wrong, do not display the default and custom shortcut keys shortcut
 
 
+1 # Maxime Lemieux 2015-05-06 18:08
Really useful. Thank you for the share
 
 
0 # 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?
 
 
0 # 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
 
 
+1 # Frank Rueter 2015-08-07 20:43
I'm guessing it's because you are using a dot in a directory name.
 
 
0 # 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!!
 
 
0 # 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.
 
 
0 # 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 ?
 
 
0 # 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.
 
 
0 # 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.
 
 
0 # 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 ?
 
 
0 # 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
 
 
0 # li zhaohui 2016-03-04 12:13
Can give me a nuke9 under the use with the shortcut keys to show.thank you.
 
 
0 # 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

:)
 
 
0 # Erwan Leroy 2017-07-14 18:45
Hi Ben.
Is there any plans to update with shortcutContext support? It would be great.
 
 
0 # 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
 
 
0 # Michael Clemens 2018-06-13 19:06
+2!!!!
 
 
0 # 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)
 
 
0 # li zhaohui 2018-06-19 03:06
No update
 
 
0 # 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.
 
 
0 # li zhaohui 2018-06-19 17:46
Do not know why, do not display in shotcut, the current shortcut key settings!
 
 
0 # li zhaohui 2018-09-19 20:05
The shortcut keys for the default settings are not displayed.
 
 
0 # 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
 
 
0 # 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:
 
 
0 # K P 2018-10-13 07:28
Great tool!

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

Cheers everyone.
 
 
0 # Peter Johnson 2018-10-29 12:00
Hi, is the Shortcut Editor v1.1 valid for Nuke 11.2v4?
Best,
Peter
 
 
0 # Corey DeFrancesco 2018-12-02 05:03
The answer is.. kinda. This plugin is in desperate need of an update. It appears to be currently abandoned by the author.
 
 
+1 # wi tae hong 2019-03-17 08:37
https://github.com/dbr/shortcuteditor-nuke

Support for Nuke 11 !!
 
 
0 # li zhaohui 2019-11-16 03:29
The shortcut keys for the default settings are not displayed.
 
 
0 # Ben Dickson 2020-08-10 06:34
Unfortunately this seems to be a bug with Nuke - there's details on the shortcut-editor 's issue tracker about this:
https://github.com/dbr/shortcuteditor-nuke/issues/9

Has now been reported to Foundry, hopefully will be fixed in future Nuke versions
 
 
0 # Ben Dickson 2020-08-12 01:11
Reported, bug 138884 - but there's also a workaround, so this is now fixed in v1.3 \o/
 
 
+2 # kiel javate 2019-09-23 08:27
this one should ship with nuke
 
 
+1 # Lars Wemmje 2020-08-14 15:52
This is so awesome Ben!
Works like a charm!
Thank you!!!

This tool was in my first UNT video :-)

I hope you keep on updating it for Nuke the future.
Nuke 13, 14,...

Cheers!
 
 
0 # li zhaohui 2020-08-18 14:32
Separate custom menus cannot be detected


menubar=nuke.toolbar("custom_tool")
m=menubar.addMenu("custom_tool", "nuke1.png")
tf = m.addMenu('Tran sform', icon='Transform.png')
tf.addCommand( "ConvertCornerP in", "convertCornerP in()", icon = "CornerPin.png" )

:sigh:
 
 
0 # Nelly Charly 2021-02-18 11:48
Thx a lot dude !!! It doesn't work for viewer :cry:
 
 
0 # Ben Dickson 2021-08-17 02:02
The Nuke viewer has a bunch of very hardcoded shortcuts which bypass the Qt-based shortcut handling which shortcuteditor uses (for example: R/G/B, tab, z/x/c - all handled directly and ignore/override the menu shortcuts)

However it should work to add shortcuts to other keys in the viewer
 
 
0 # GBoy Vega 2021-04-26 17:08
It doesn't appears in Nuke 13. An update would be great! Thanks in advance.
 
 
0 # Peter Johnson 2021-06-08 14:52
Hi, I'm trying to install the shortcut editor to NukeStudio 13.0V2, without success.
I get this feedback:
Traceback (most recent call last):
File "C:/Users/sehpe or/.nuke/menu.p y", line 2, in
import shortcuteditor
File "C:/Users/sehpe or/.nuke\shortc uteditor.py", line 301
print "Settings file %r does not exist" % (path)
I have added the shortcuteditor. py and menu.py to the .nuke folder. I guess I'm going wrong already by not really understanding the meaning of:
Put shortcuteditor. py on PYTHONPATH or NUKE_PATH
I'm on Windows.
Appreciate guidance!
//Peter
 
 
0 # Ben Dickson 2021-08-17 01:58
This should be fixed in v1.3 - there was a few minor tweaks needed to run under Python 3 which Nuke 13 uses!
 
 
0 # Martin Rombos 2022-02-13 20:07
Hi, Is there any way to get it to work in Nuke Studio for thimeline shortcuts? It seems that only works when I get into a comp (Nuke mode).
Thanks!
 
 
0 # Martin Rombos 2022-03-15 11:08
"File/Open Recent" Doesn't seem to be working after relaunch.

Seems that it sticks to the names of the projects that are present when you change the shortcut?
 

You have no rights to post comments

We have 3168 guests and 87 members online