Hooking up menu under the first menu named RV

On the rv, top right the first menu item we see is RV,
I tried to access the first menu RV doing like this:

menu = [("RV", [("_", None), ("Set User Prefs", menuItems)])]

but this create a new RV menu item named rv and under which is my new menu item name "Set User Prefs"

The PACKAGE file contains:

modes: 
  - file: user_prefs_manager.py
    load: immediate
    menu: 'RV/Set User Prefs'
    load: delay

Any idea how do I hook my menu item Set User Prefs under existing RV instead of creating a new one.

2 Likes

Hey!

Thanks for messaging us.

Unfortunately it looks like the specific RV menu doesn’t allow dynamic binding to it via normal init method. It’s just straight up PySide QAction binding.

Would you mind telling us a bit more about the contents of your package? Are you setting up an entire panel of preferences or are you enabling certain preferences within RV’s existing panel?

I’ll try seeing if there’s a way to accomplish this via PySide, though you can take a look yourself meanwhile too.

Thanks,
Alexa

2 Likes

Thank You Alexa for getting back on this,

We have some rv to user specific settings stored in the config in the user directory, and using our own organisation api we can update config, however I was trying to add a menu item to update the settings in the user preference.

1 Like

Hey,

I dug around a bit and it looks like there’s not really a way to add to that RV menu at all. It’s static and has no parent that you can access via qt outside of C++. Lame!

However, if you’d like to have all of your preferences in one place and have them look super RV-like, you can add a tab to the RV Preferences!
It will look like this (and you can rearrange tab to show up first if you’d like):

And here’s the example code I used to generate it. Please note that I used PySide2, if you’re still on Qt4 you’ll need to import QtGui instead of QtWidgets.

Example_Package_ExampleRVMenu-1.0.rvpkg (1.2 KB)

Hope this helps!

Thanks,
Alexa

3 Likes