Tk-nuke - Add to menu or shelf

Hey there,

:diamonds: I’d like to add some tools to the SG button in Nuke shelf.


How can I simply create new buttons calling python code in this shelf?

:diamonds: From the doc:

You can add your own shortcuts based on template paths in your current environment with the favourite_directories setting

I tried adding this to tk-nuke.yml, but nothing changed in the SG menu or the SG shelf:
  apps: [...]

  menu_favourites: [...]
    - display_name: "Shot Images Folder"
      template_directory: "shot_images_base"
      icon: "" 

  location: [...]

What have I missed?



Hi @benwall

The favorite directories are specifically for the shortcut paths in the open window in Nuke, so that won’t help you there,

You might be able to use the Nuke API to find the menu and add additional items to it, though I’m not sure what would happen when the engine refreshes, they might all get cleared out.

I think the only way to really do it would be to have a custom app that registered actions there.
You can use the write node app as an example, it registers a type="node" command with the engine, which in turn takes care of creating the menu item.

So if you have a bunch of scripts that are not Toolkit apps, but you would like to register them, then you could:

  1. Turn all the scripts into basic toolkit apps.
  2. Create a single toolkit app, that registered all the scripts as commands.



Thanks for your answer