Parsing nuke.hotkeys() for Hotkey Viewer GUI

Written by Tae Hyung Lee on .

For GUI in Nuke, we need to .ui file using QT Designer.

There is one I already made for typical keyboard but you can download it from my github and modify.

https://github.com/hslth/NukeHotKey

 

I want our own pushbutton so let's promote it to other name

Screenshot_from_2016-08-16_19_38_52.png

I named it HotKeyButton.

Screenshot_from_2016-08-16_19_39_39.png

Personally I don't prefer to load .ui file directy from main python file.

I would convert .ui file to .py file using pyuic4 command

Screenshot_from_2016-08-16_19_40_24.png

Our pyuic4 command is from pyqt4 so let's add try except to load pySide in ui_hotkey.py

Screenshot_from_2016-08-16_19_49_26.png

so it's done. You are ready to open the ui file in Nuke.

Copy the ui_hotkey.py file to somewhere your Nuke can load. (ex: your homefolder/.nuke)

 

To show basic Dialog or Widget, you need to have main body class inherited QDialog or QWidget.

Screenshot_from_2016-08-16_19_55_39.png

If you execute those script, this will show empty dialog.

Let's import our ui_hotkey and call setupUi function of the Ui_Form class.

Screenshot_from_2016-08-18_21_02_28.png

We have 5 steps to do

1. Check hotkeys (ex: "Nodes/Image/Write", "W")

2. Get HotKeyButton instance corresponding 'KEY' instance

3. Store Key information to HotKeyButton instance.

4. When the Button is clicked, print it to TextBrowser

5. Color HotKeyButton when Viewer Nodes Nuke checkbox is checked.

 

In https://github.com/hslth/NukeHotKey/ there is code for each step.

In next tutorial, I would introduce some detail code review of each step and check box integretion with HotKeyButton color.

 

Tae Hyung Lee

 

 

Comments   

 
# ji hyung Jung 2016-08-24 07:57
Oh ! good boy
 

You have no rights to post comments

We have 2496 guests and 97 members online