ID 415305 - FarmAPI Menu commands do not work when chosen in Utils menu

Follow

Problem summary

Farm API menu options added via FarmAPI.AddFarmMenuOption() do not trigger their connected action when selected in the Utils menu.

Customer reported version
Katana 3.2v2

Steps to reproduce

  1. In a KATANA_RESOURCES directory (for example the .katana folder in your home directory), create a Plugins subfolder if it doesn't already exist.
  2. In the Plugins folder, create a FarmAPI.py file containing the following Python code:

    from Katana import FarmAPI


    def onStartup(**kwargs):

        # Add menu options

        FarmAPI.AddFarmMenuOption("Potato", _printPotato)

        FarmAPI.AddFarmPopupMenuOption("Potato", _printPotato)


    Callbacks.addCallback(Callbacks.Type.onStartup, onStartup)


    def _printPotato():

        print "Potato"


  3. Launch Katana
  4. In the main Katana menu, select Utils > Potato

Expected behaviour
The callback connected to the menu option should be triggered, printing "Potato" to the console.

Actual behaviour
The callback connected to the menu option is not triggered and nothing is printed to the console.

Workaround
Use the FarmAPI.AddFarmPopupMenuOption() function instead to add a menu option to Render nodes' context menu and select the option from there.

Reproduced by support

This bug has been reproduced in:
Katana 3.2v2 - Windows 10/CentOS7

Katana 3.1v1 - Windows 10/CentOS7

Unable to reproduce bug in:

Katana 3.0v9 - Windows 10/CentOS7 - This issue doesn't appear in this version and has regressed

Katana 3.0v1 - Windows 10/CentOS7

Katana 2.5v1 - Windows 10/CentOS7

    We're sorry to hear that

    Please tell us why