O'Reilly logo

Practical Maya Programming with Python by Robert Galanakis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with menus

Working effectively with Maya's menu system involves marrying Maya UI commands with PySide to get the best of both worlds. Maya's menus are an abstraction of standard Qt widgets, and we should use that same abstraction, through UI commands, rather than creating our own. However, we may still want to work with the controls in more sophisticated ways than Maya allows, requiring us access to the actual Qt object.

For the next few sections, we'll create a way to highlight menu items as new until the first time they are clicked.

Creating a top-level menu

Maya's UI commands work just like its other commands. A UI object is represented by a pipe-delimited hierarchical path, such as 'MayaWindow|DemoMenu|menuItem254'. When we use a command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required