ID 536366 - 300+ actions are missing during startup, meaning hotkeys cannot be assigned to them during startup

Follow

Problem summary
300+ actions are missing during startup, meaning hotkeys cannot be assigned to them during startup
 
Customer reported version
mari.6.0v1
 
Customer reported platform
windows10
 
Steps to reproduce
 
1) In your Mari/Scripts directory, make a new file called test.py
 
2) In the test.py file, add the following code and save the file:
 

import mariprint (len(mari.actions.list()))actionpath = '/Mari/NodeGraph/Create/Misc/Teleport Receiver'action = mari.actions.get(actionpath)action.setShortcut("R",mari.actions.NODE_GRAPH)
 
3) Open Mari
 
4) Open the Python console, it will print a Number, then error
 
5) In the Python Console, run the print command again, it will be a different number:
print (len(mari.actions.list()))
 

 
Expected behaviour
For the numbers to be the same, and the shortcut to be set
 
Actual behaviour
Mari doesn't have all the actions available when loading custom Startup scripts, so the numbers are different, and setting the shortcut errors
 
Workaround
You can delay when the code is run by using a QTimer, at which point all the actions seem to be available:
 
import marifrom PySide2.QtCore import QTimerQTimer.singleShot(0, lambda: print(len(mari.actions.list())))def setNodeGraphShortcut(shortcut, actionpath):	action = mari.actions.get(actionpath)	action.setShortcut(shortcut,mari.actions.NODE_GRAPH)actionpath = '/Mari/NodeGraph/Create/Misc/Teleport Receiver'QTimer.singleShot(0, lambda: setNodeGraphShortcut("R", actionpath))
 
Reproduced by support
This bug has been reproduced in:
Mari 6.0v1 - Windows 10, CentOS 7.9
Mari 5.0v2 - Windows 10, CentOS 7.9 - regression
Mari 4.8v2 - Windows 10 - regression
 
Unable to reproduce bug in:
Mari 5.0v1 - Windows 10, CentOS 7.9
Mari 4.8v1 - Windows 10
 
Earliest version tested
Mari 5.0v1/4.8v1 - This issue doesn't appear in this version and has regressed
 

    We're sorry to hear that

    Please tell us why