Get children in menu does not work in Maya 2020, but in 2019

Get children in menu does not work in Maya 2020, but in 2019

Anonymous
Not applicable
690 Views
2 Replies
Message 1 of 3

Get children in menu does not work in Maya 2020, but in 2019

Anonymous
Not applicable

Hey,

I had a script that gets the children in a menu:

print cmds.menu('mainFileMenu', query = True, itemArray = True)

This works perfectly in Maya 2019 and returns a list with all the children, but in Maya 2020 the result is None, why is this the way?

Can someone please help!

0 Likes
Accepted solutions (1)
691 Views
2 Replies
Replies (2)
Message 2 of 3

mspeer
Consultant
Consultant

Hi!

 

Have you opened the File menu at least once in Maya 2020 before using this command?

Here it works the same as in Maya 2019.

0 Likes
Message 3 of 3

zewt
Collaborator
Collaborator
Accepted solution

You can force the menu to be built by running buildFileMenu.  You can see the others in scripts/startup/initMainMenuBar.mel.