SUMMARY
When launching Nuke scripts by double-clicking the icon, they generally launch with the latest installed version. This article explains how to update the default settings for opening .nk scripts in any specified version, and by which Nuke product it launches, either Nuke or NukeX.
MORE INFORMATION
Launching Nuke by double-clicking the script can save time, and when doing so, the user expects a specific version or product to open. The following dropdowns provide information on specifying a Nuke application and version for their respective operating system.
Windows
In Windows, one method to update the Nuke scripts is by editing the file Properties for Opens with and selecting the correct application. To enable launching Nuke 16.0v4 as a default application when double-clicking the .nk file, please perform these steps:
- Locate and right-click on a Nuke script that has the .nk extension.
- In the context menu select Properties.
- Click Change... to choose from a list of applications.
- Select a Nuke application from the list, or if needed select Look for another app on this PC, and choose any installed Nuke application as a preference.
NOTE: Double-clicking the .nk scripts will now open it with the default application. This procedure can also be used for .hrox Nuke Studio/Hiero project files as needed.
macOS
On macOS, the process is different than Windows for setting the default launch application. Please perform the following to update the default Nuke application when double-clicking the .nk script:
- Locate and right-click on a Nuke script that has the .nk extension.
- In the context menu select Get Info.
- Click Open With to expand the selection.
- Select the application dropdown and choose any installed Nuke application as a preference.
- Click Change All… and then Continue to set the default application.
NOTE: Double-clicking the .nk scripts will now open it with the default application. This procedure can also be used for .hrox Nuke Studio/Hiero project files as needed. Please also keep in mind that the default application settings on macOS are only changed per User Account.
Linux [CentOS 7/Rocky 9]
For the Linux distributions, Nuke has its own mime type (application/x-nuke), which will need to be added to a file list in a specific directory before being able to double-click .nk scripts for launching Nuke. More information on this can be found in the Further Reading section. Please perform the following to launch .nk scripts on the Linux platform:
NOTE: Please keep in mind that this was tested on CentOS 7/Rocky 9 with the GNOME desktop environment. Other desktop environments and file locations may vary.
- In Terminal, change to the following directory: /usr/share/mime/packages
- As sudo, open any terminal text editor such as nano or vim, and create a file called “applications-x-nuke.xml”. Example:
sudo nano applications-x-nuke.xml - Copy/paste the following code:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-nuke">
<comment>NukeScript</comment>
<glob pattern="*.nk"/>
</mime-type>
</mime-info>
- Save and exit the .xml file (Ctrl+O, then Ctrl+X in nano)
- Update the mime database to ensure it takes effect:
sudo update-mime-database /usr/share/mime - Then update the application database:
sudo update-desktop-database /usr/share/applications - Copy the created .xml file to ~/.local/share/mime/packages/ with the command:
sudo cp applications-x-nuke.xml ~/.local/share/mime/packages/
NOTE: There’s a chance that the /mime/packages/ directory is not already available. In this instance, run the following command to create the directories first, before copying the file over:mkdir -p ~/.local/share/mime/packages/ - Update the mime database for that location:
sudo update-mime-database ~/.local/share/mime - Update the application database:
sudo update-desktop-database ~/.local/share/applications - Log out of the current user, and then log back in to apply any changes made.
NOTE: There may be errors related to other Linux mime-types when updating the mime databases, as shown in the screenshot below. These can be ignored for the purpose of creating the applications/x-nuke mime type. Please view the Further Reading section for more information on the update-mime-database and update-desktop-database commands.
As of Nuke 12, Nuke no longer creates shortcuts when being installed, so shortcuts will need to be created manually. A feature request to change this behaviour is logged as: ID 162266 - Add the ability to control which Desktop Icons are installed/added to the desktop
Shortcuts can be created by:
- In Terminal, change to the following directory: /usr/share/applications/
- As sudo, open any terminal text editor such as nano or vim, and create a file called “Nuke16.0v4.desktop”. Example:
sudo nano Nuke16.0v4.desktop - Copy/paste the following code:
[Desktop Entry]
Name=Nuke16.0v4
Comment=
Exec="/usr/local/Nuke16.0v4/Nuke16.0" --nuke -b %f
Terminal=false
MimeType=application/x-nuke;
Icon=/usr/local/Nuke16.0v4/plugins/icons/NukeApp48.png
Type=Application
Categories=Graphics;2DGraphics;RasterGraphics;FLTK;
- Save and exit the .desktop file (Ctrl+O, then Ctrl+X in nano)
More information about creating shortcuts on linux can be found here: Q100521: How to create a desktop shortcut for Foundry software on Linux operating systems
It may also be necessary to add or adjust the application/x-nuke mime type in the mimeapps.list. Please edit the list with the following command in terminal: nano ~/.config/mimeapps.list
Then if they are not already available, please add the following lines to the [Added Associations] and [Default Applications] list for your latest version of Nuke, as shown in the screenshot below:application/x-nuke=Nuke16.0v4.desktop;application/x-nuke=Nuke16.0v4.desktop;
The .nk script should now be associated with the desired application, and when double-clicked, launch the correct version.
As an alternative method in Linux with the GNOME desktop, and as long as the mime-type was registered, you can perform the following for opening the .nk script with Nuke as a default application:
- Right-click the associated file type (.nk)
- Select Open With Other Application.
- Click any Nuke or NukeX application and press Select.
NOTE: Please keep in mind that doing this method may change the behavior of other default applications of the same type (i.e plain text document). If you do not want other text files opened with Nuke, instead of setting it as Default, just right-click the Nuke Script and select Open with Application > Nuke, or set the mime-type from the first method.
FURTHER READING
- To assist in desktop setup for Linux, please view more information on installing Nuke on the Linux platform.
- As of Nuke 12, the installer no longer includes application icons. Please view the following article for more information on how to create desktop shortcuts in Linux.
- Please also view the following for creating desktop shortcuts with additional flags.
- Additional information on the MIME type in GNOME can be found on page 53 of this Red Hat guide and GNOME 2.14 guide
- More information regarding the MIME database updates can be found here:
- update-mime-database | update-desktop-database
FURTHER HELP
If you are still experiencing issues after trying the provided steps above, please open a Support request and let us know the exact issue encountered and the troubleshooting steps that have been taken.
For more information on how to open a Support request, please refer to this article: Q100064: How to raise a support ticket
Attachments:
We're sorry to hear that
Please tell us why