Problem summary
Nuke 9.0v1 and later can use Hiero's python libraries for coding hiero-ic functions within Nuke/NukeStudio. You can use "import hiero" in the Script Editor to load these libraries.
However, if you try to define Hiero python functions within your init.py or menu.py in your .nuke directory, Nuke will fail to load. (See below error)
Customer reported version
NukeStudio 9.0v1
Customer reported platform
Windows 7
Steps to reproduce
1) Create a text document
2) add 'Import Hiero' to the document and save as a '.py' file
3) Open NukeStudio in command prompt or terminal with your script, example below:
Result - Nuke will fail to load with the following error:
import hiero
File "C:\Program Files\Nuke9.0v3\pythonextensions\site-packages\hiero\__init__.py", line 2, in
import FnRedirect
File "C:\Program Files\Nuke9.0v3\pythonextensions\site-packages\hiero\FnRedirect.py", line 1, in
from _fnpython import *
ImportError: No module named _fnpython
Workaround
To add Hiero customisation to NukeStudio startup scripts, you need to add your Python script into the following directory: ~/.nuke/Python/Startup (This is the Hiero file structure for python customisation.)
As _fnpython is a private module which is created in the application code (similar to _nuke). The reason this doesn't work is that init.py is executed before Hiero's Python modules are properly initialised.
So currently the only option to startup Python files which need to call the hiero APIs is that they need to be placed in the location as above (~/.nuke/Python/Startup).