Moving buttons from the Quick Favorites menu to the user panel

Unfortunately, the developers have not yet provided access to the Quick Favorites menu via the Python API in Blender. However, it is possible to transfer the entire menu to the user panel. We can simply draw the Quick Favorites content on the user panel layout.

First, let’s add a few operators to Quick Favorites, if you haven’t done so before.

The easiest way to add any operator to Quick Favorites is to right-click on the desired button in the Blender interface or on the desired menu item, and select “Add to Quick Favorites”. Now, when we press the “q” key, a new item with a call of this operator will appear in the pop-up menu.

Now, define the user panel class.

Our panel interface will be drawn inside the “draw” function.

We will place the UI output from the Quick Favorites pop-up panel here by calling the “menu_contents()” function, in the parameter of which we will pass the identifier of this menu – “SCREEN_MT_user_menu”.

Our “draw” function will look like this:

Register our panel class in the Blender Python API.

Now we can execute the code and verify that all operations from the Quick Favorites menu are displayed as buttons on our custom panel.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments