-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.py
More file actions
29 lines (25 loc) · 1.23 KB
/
Copy pathinit.py
File metadata and controls
29 lines (25 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SpectralRenderer -- plugin loader
# Place this file alongside SpectralRender.dll in your NUKE_PATH
# or add this line to your ~/.nuke/init.py:
# nuke.pluginAddPath('/path/to/SpectralRender')
import nuke
import os
# SpectralRenderer requires Nuke 17+ (USD/USG scene graph API)
if nuke.NUKE_VERSION_MAJOR < 17:
pass # silently skip -- plugin won't load in older Nuke
else:
# Add the directory containing this init.py to the plugin path
plugin_dir = os.path.dirname(__file__)
if plugin_dir:
nuke.pluginAddPath(plugin_dir)
# If VDB DLLs are in a lib/ subfolder, add to system PATH
lib_dir = os.path.join(plugin_dir, "lib")
if os.path.isdir(lib_dir):
os.environ["PATH"] = lib_dir + os.pathsep + os.environ.get("PATH", "")
# Force-load SpectralRender.dll so ALL node classes register at startup.
# Currently registered: SpectralRender, SpectralSurface, SpectralDrafting,
# SpectralShadowCatcher, SpectralVolumeMaterial, SpectralMeshProperties,
# SpectralVDBRead, SpectralVolMerge, SpectralEnvLight, SpectralStudioLight.
# Without this, only SpectralRender registers on first use -- the others
# show "Unknown command" until a SpectralRender node is created.
nuke.load("SpectralRender")