What does it do:
Automates the creation of a menu and sub menu's for every folder in a directory populated with every Python script added along with an icon, nice name, shortcut and setup to be executable when clicked. Now with support for multiple menu entries per "script.py" that can all be given custom icons and hotkeys.
How to use it:
Place your python scripts into the ".nuke/yokai_tools/scripts" directory.
Any sub folders will be added as sub menu's recursively. The number of sub menu's is limited only by your Operating System's maximum file depth.
Add the following attributes to the top of your scripts:
nice_name = "The Example Script" # Optional
run_cmd = "execute_func()" # Important
hot_key = "ctrl+alt+shift+e" # Optional
menu_icon = "coffee2.jpg" # Optional
If no "nice_name " attribute is found in the script, it will use the script file's name.
You can define multiple run_cmd's to run a number of functions in the same script or the same functions with different arguments.
If no "run_cmd" attribute is found in the script, it will default to use "run()" to attempt to execute the script.
If no "menu_icon " attribute is found in the script, it will look for an icon with a name to match the script. If there are still no icons to be found, you can use the "random_icons" flag in the "menu.py" to assign it a random icon from your icons directory.
The menu_icon specified can be either just a filename (coffee2.jpg) if it is in Nuke's environment. Otherwise you can give it a full directory path and it will be added as well.
You can also add a list of directories in which to search for menu icons without a specified directory.
Copy the contents of the provided "dotnuke" folder to your local ".nuke" directory.
If you already have a "menu.py", simply append the contents of the provided one to your own.
Dump all of your scripts into the ".nuke/yokai_tools/scripts" directory. If it does not exist, it will be created when nuke is next run.
The user may now add a list of icon search directories into the script in the format:
more_icon_directories = ["/home/travisharvey/.nuke/cube_inc_icons",
This is used for icon's found based on having a matching script name as well as extra places to look for icons defined as:
menu_icon = "coffee2.jpg"
For personal use and one commercial project (up to 2,000 sales or 20,000 views).Tutorials
One copy to be used by a single user.Installable Tools
One installation by a single user.Learn More