Create a ticket
Follow

Q100373: How to add plug-in paths to Nuke Studio and Hiero

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.

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 requires 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 are 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 colon : , similar to how Nuke’s NUKE_PATH works. 

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 a the following Python commands:

import hiero.core
hiero.core.addPluginPath(“/custom_plugin_path”)


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


These lines of code are usually included in a init.py file inside the user's .nuke folder, inside a Python/Startup directory.


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 NukeStudio on startup

 

 

Was this article helpful?
/

We're sorry to hear that!

Please tell us why.
0 out of 0 found this helpful