About:
This tutorial will describe how to create a init.tcl file which will add user specified directories which Nuke will use for plugin or tcl source directories.
If your like me and use multiple versions of Nuke then you may use separate directories for storing tcl scripts, gizmos, and plugins for different versions of Nuke. This tutorial will describe how to store them all in your "/Documents and Settings/$USER/.nuke" or "/home/$user/.nuke" directory and have Nuke only read those specified for a specific version.
Commands:
The two tcl commands you can add to an init.tcl that will add a plugin directory path are.
1: plugin_addpath
2: plugin_appendpath
plugin_addpath:
This will add the path to the beginning of Nukes plugin paths.
plugin_appendpath:
This will add the path to the end of Nukes plugin paths.
What is the difference?
The difference is if you use plugin_addpath then your preferences.nk and window_layouts.nk file will be saved into this directory since it will be the first directory listed under plugin_path.
Example 1:
This example will demonstrate having a directory used to store plugins, this plugin directory contains sub-directories one for each version of Nuke. Depending on which version of Nuke is running it will only add the corresponding plugin directory for its version.
You could even get more creative and have the path being added search for environmental variables, my personal init.tcl file replaces the above code with.Code:# Add plugin directory path(s) for user binary plugins. # Set paths based on the version of Nuke being launched. switch [set nuke_version] { "4.6000" {plugin_appendpath "/home/nrgy/.nuke/plugins/NFX/4.6"} "4.7100" {plugin_appendpath "/home/nrgy/.nuke/plugins/NFX/4.7v1"} "4.7200" {plugin_appendpath "/home/nrgy/.nuke/plugins/NFX/4.7v2"} "4.7300" {plugin_appendpath "/home/nrgy/.nuke/plugins/NFX/4.7v3"} }
It grabs the environmental variable HOME and then uses that as part of the path.Code:# Add plugin directory path(s) for user binary plugins. # Set paths based on the version of Nuke being launched. switch [set nuke_version] { "4.6000" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.6"} "4.7100" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v1"} "4.7200" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v2"} "4.7300" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v3"} }
Example 2:
This last example is my init.tcl file, it will append my NFXPlugins directories to the plugin_path as well as add 2 other directories one which contains gizmos and the other tcl scripts.
Code:# Add plugin directory path(s) for user binary plugins. # Set paths based on the version of Nuke being launched. switch [set nuke_version] { "4.6000" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.6"} "4.7100" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v1"} "4.7200" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v2"} "4.7300" {plugin_appendpath "[set env(HOME)]/.nuke/plugins/NFX/4.7v3"} } # Add test plugin directory path(s) for binary plugins. plugin_appendpath "[set env(HOME)]/.nuke/plugins/test" # Add gizmo directory path(s) for user gizmos. plugin_appendpath "[set env(HOME)]/.nuke/gizmos" # Add tcl directory path(s) for user tcl scripts. plugin_appendpath "[set env(HOME)]/.nuke/tcl"








