Questions about loading RV plugins

Hi -
I have 2 related questions about ways to control plugin loading in RV.

  1. I have 2 plugin Modes that share a single PACKAGE file. Ideally I’d like both of them to be delayed load, but have them load with the same hotkey (when it is pressed, load both of them, in other words). One of them (a Mu file) already uses the hotkey/menu item, but I’d like the other one (Python file) to also get loaded at the same time. Is there a way to set that up in the PACKAGE file, or a way to programmatically load one from the other?
  2. Is there an easy mechanism to optionally load certain plugins on startup based on something like an environment variable?



If you set the hotkey in your package for the mode, what happens? Each mode can have a hotkey associated with it.

Forgive me I haven’t tried it so I don’t know if it swallows the event or not. If it does, you could assign each mode a custom event to trigger on and then send the internal event to that custom event when you get the hokey you care about.

Hey Michael - thanks for the reply!
From testing it a bit, I get the feeling the first mode in the list swallows the event, so the 2nd one never notices it.

But I did get something working that sounds a lot like what you’re suggesting, if not exactly the same. The first mode responds to a hotkey event (specified in the PACKAGE file), and then in its createMode function, it does something like sendInternalEvent(“load-py-plugin”), and the other Mode is set to activate based on that custom event in the PACKAGE file. Seems to work!

For #2, I realized it might be a little confusing – I don’t really expect an env var to trigger the plugin loading, but was just wondering if there’s a dynamic way to specify that some plugins should load and others shouldn’t at load time. The env var could just be the mechanism to know how to configure them.


1 Like

Hello Alan,
did you reject the event in your method?
It says in the manual:

reject (void;)
Calling this function will cause the event to be send to the next binding found in the event table stack. Not calling this function stops the propagation of the event.

I did think of that, but didn’t pursue it too far, as it didn’t appear to be possible in this kind of case. Normally when I explicitly bind an event to a callback function, the function has an “event” parameter that gets passed in, but in this case, the binding isn’t so explicit, as I’m just specifying the “event” to use for toggling on/off the plugin loading in the PACKAGE file. I assume that calling the Mode’s createMode() function, but don’t see an event parameter for that function, where I could access the event, to be able to reject it. Do you know of a way to access that event? Because that would be a simpler way to do it, if I could.


Sorry, so far I can’t think of a way, that doesn’t sound more complicated than what you described in your answer.

Just out of curiosity, why don’t you load it immediately and then bind a key-down event to it to initialise your code?
Also , have you tested putting your modes in different packages and loading them with the same shortcut?

1 Like

As for the env var, you could probably use the rvpkg Command Line Tool?!
First check the value of your env var and -optin if needed.

1 Like

Those are some good ideas I’ll have to try - thanks!