ID 241931 - Unable to add Action to Selection Group Context Menu

Follow

Problem summary
Adding context menus to the right click menu in the selection groups palette currently produces inconsistent results.

The menu entries are only present when on project creation or load at least one selection group existed in the selection group list. If no selection group existed, custom menu entries are disregarded.
Customer reported version
3.1v3
Customer reported platform

Steps to reproduce

1) Load any object, creating a new project

2) Do not create selection groups on project creation, so when the project is first created no item is in the selection group list.

3) Run the following code in the python console

UI_path = 'MriFaceSelectionGroup/ItemContext'
testaction = mari.actions.create("/Mari/Debug/My Test Action", "")
mari.menus.addAction(testaction, UI_path)

4) Create a selection group

5) Right mouse click on the selection group. You will see the action 'My Test Action' does not appear.

6) Rerun the code. The action will now correctly appear in the right mouse click menu and will so for as long as the project has at least one selection group

Workaround
Always launch a project with at least one selection group



Actual behaviour
The menu entries are only present when on project creation or load at least one selection group existed in the selection group list.
If no selection group existed, custom menu entries are disregarded.


Expected behaviour
The menu entries should always be present

    We're sorry to hear that

    Please tell us why