Plucky PyMenu Populator
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.
Software:
Foundry: Nuke
How to use it:
Place your python scripts into the ".nuke/yokai_tools/scripts" directory.
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.
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.
Installation Instructions:
Copy the contents of the provided "dotnuke" folder to your local ".nuke" directory.
Windows: {drive_letter}:\Users\{username}\.nuke
Linux: /home/{username}/.nuke
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.