RV can be nearly infinitely customizable but it can be difficult finding documentation for where to begin developing your own plugins.
There are a couple of things that you should know.
RV offers a couple of ways to write plugins: Mu, Python, PySide and GLSL.
The best way to start with RV scripting is to use Python. Unfortunately, Python is not native to RV and most of “Python” commands that you will find in RV are bindings on top of Mu. However, this means that you can use nearly all commands that are available in Mu in Python.
Mu is the native scripting language and kind of looks like Perl. Most of the RV documentation that is historically available is written in Mu. Unfortunately, this is a difficult way for someone to get started scripting, so I won’t go too deep into it in this post, except for bindings from Python <-> Mu. If you have plenty of time and would like to understand how Mu works, you can find it by going to
RV -> Help -> Mu User's Manual.
A simple package for RV contains 2 files, a .mu or .py plugin and a text PACKAGE file. PACKAGE file is a description file that RV’s package system will use to determine how to load your package. Syntax for PACKAGE file is in YAML.
- Download the following 2 files:
Copy paste this into an Example_Package_MyStuffMode.py file:
from rv import commands, rvtypes from rv.commands import NeutralMenuState class Example_Package_MyStuffMode(rvtypes.MinorMode): def __init__(self): rvtypes.MinorMode.__init__(self) globalBindings = None #[("Event-Name", self.eventCallback, "DescriptionOfBinding")] localBindings = None menu = [ ("Example", [ ("Run Example", self.runExample, None, lambda: NeutralMenuState), ]) ] self.init("Example_Package_MyStuff", globalBindings, localBindings, menu) def runExample(self, event): print "DEBUG: Example Ran." def createMode(): return Example_Package_MyStuffMode()
Paste this into a PACKAGE file:
package: MyStuff author: Alexa Zalipyatskikh organization: Autodesk contact: firstname.lastname@example.org version: 1.0 requires: '' rv: 7.3.1 modes: - file: MyStuffMode load: immediate description: | <p>Description of package here.</p>
Now zip up the
PACKAGEfile into a
Example_Package_MyStuff-1.0.rvpkgfile. NOTE: You need to specify the version of the RV Package in the file name as well as the PACKAGE file itself. Otherwise RV won’t load the package.
Launch RV and navigate to
RV -> Preferences... -> Packages -> Add Packages...Then navigate to your
Example_Package_MyStuff-1.0.rvpkgfile. RV will ask you where you would like to install the package. This is your
Make sure that both of the checkmarks are
ONnext to the package, then restart RV.
Window -> Consoleand leave it where you can see it. You should now have an
Example -> Run Examplemenu in RV. Click on
Run Example. You should get a “Example ran” show up in the Console.
You can modify your plugin in
RV_SUPPORT_PATH(where you installed plugin) under
RV_SUPPORT_PATH/Python/Example_Package_MyStuffMode.py. You will need to restart RV every time you modify the python file there, but you WON’T have to reload the package. If you’re modifying your Python outside of the
RV_SUPPORT_PATH/Python/Example_Package_MyStuffMode.py, you will need to re-install the package every time.
Congrats, you have installed your first package!