SUMMARY
This article explains how to add plug-in paths to Nuke Studio and Hiero, to load and use additional plug-ins and Python modules. This can be done using either the HIERO_PLUGIN_PATH environment variable or the hiero.core.addPluginPath() function.
As of Nuke 14.1 and 15.0, the HIERO_PLUGIN_PATH environment variable is being deprecated, and in place will now use NUKE_PATH, which should behave the same.
MORE INFORMATION
When Nuke Studio and Hiero scan for Python modules or plug-ins to import, they search all <path>/Python/Startup and <path>/Python/StartupUI locations for any Python modules or packages containing __init__.py files, or other plug-ins like Gizmos. This means that your custom module or plug-in directory structure must have /Python/Startup or /Python/StartupUI directories defined.
The scanning is done first in all the /Python/Startup folders and then in all the /Python/StartupUI folders. Any Python startup scripts found will be imported in alphabetical order and loaded as plug-ins for Nuke Studio and Hiero to use.
Environment variable method:
To affix an additional <path> locations to the list of plug-in paths that Nuke Studio and Hiero scan for, you can use the environment variable HIERO_PLUGIN_PATH. Multiple paths need to be separated by a semicolon ; on Windows, or a colon : on macOS and Linux.
For example, if you set HIERO_PLUGIN_PATH to /mnt/networkdrive/shared/plugins, Nuke Studio and Hiero will scan the following directories in order:
/mnt/networkdrive/shared/plugins/Python/Startup/mnt/networkdrive/shared/plugins/Python/StartupUI
Information about how to set environment variables can be found in the following article: Q100015: How to set environment variables
Python Method:
You can also append additional <path> locations using the following Python commands:
import hiero.core
hiero.core.addPluginPath("/custom_plugin_path")These lines of code are usually included in a init.py file inside the user's .nuke folder, inside a Python/Startup directory.
Since Nuke Studio and Hiero look for Python modules or plug-ins under a <path>/Python/Startup and <path>/Python/StartupUI location, the new plug-in path appended using the command above needs to include either Python/Startup or Python/StartupUI explicitly in the file path.
For example, if you run the following line of code:
hiero.core.addPluginPath("/mnt/networkdrive/shared/plugins")Nuke Studio and Hiero will scan the following directories in order:/mnt/networkdrive/shared/plugins/Python/Startup/mnt/networkdrive/shared/plugins/Python/StartupUI
FURTHER READING
More information on how to use the Python/Startup and Python/StartupUI directories can be found here: Q100142: How to execute Hiero Python code in Nuke Studio and Hiero on startup
Additional information on both the Environment Variable and Python methods outlined above can be found in the Environment Setup section of our Python API documentation.
We're sorry to hear that
Please tell us why