Welcome to the RizomUV Scripting page! Scripting in RizomUV VS and RS is a great way to automate or enhance a lot of tasks, and we hope this page will help you get started.
And getting started is pretty easy! When you use either version of RizomUV, everything you do is automatically transcribed into LUA commands and echoed into the Script Log window. You can access this window via Tools>Script log Window, or by pressing L on your keyboard.
The script window is handy when learning and designing scripts, as everything you do can be copy/pasted or saved, kind of like macros. And keeping an eye on and experimenting with what goes on in the Script Log while using RizomUV can seriously speed up your learning process using the scripting API.
The first thing you should know when scripting in RizomUV, is that there are several methods available to edit and run Lua script files:
Using the Script and Command Log Window:
The RizomUV Standalone (Virtual Space and Real Space) versions come with a dialog designed to generate simple scripts and to experiment with the API, should you have the SDK.
- Run RizomUV
- Open the Script and Command Log Window by pressing the “L” key on your keyboard.
- The upper part of the dialog is the script editor, where you can write and debug your scripts
- The lower part is the command log. Each time an action or operation is executed or invoked by a script in the standalone’s UI, it is translated into Lua and/or displayed into the command log window for your convenience.
- Try it out! You can even do the ubiquitous “Hello World!” in RizomUV – here’s how:
- In the upper part of the dialog, write print “Hello World!”
- Press Execute
- You should see the string “Hello World!” echoed in the command log window.
Using the Script and Command Log Window:
Located in the far right of the top panel when using the standard RizomUV layout, the Script Hub Panel allows you to load and keep several script files loaded. Aimed at being an easily accessible script repository, as well as a placeholder for several scripts you are developing, it makes scripting a snap:
- The top part – the range saying S0-S07 – is where you execute your loaded scripts. On mouse-over it will always show the path and name of the script currently loaded
- The middle part saying Ed (for Edit) is where you click to modify your script in an external editor like freebie Notepad++ or the Visual Studio Code editor.
- You will need to define your script editor, if any, by adding its path in Edit>Preferences.i.e:
C:\Users\YourName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Visual Studio Code.exe
- The Ellipsis (…)at the bottom of the button is where you click to load your script file. Remember to check it has a Lua extension or it will not show
Currently Available Scripts
Remote Control File Path
Located in the far lower left of the Script and Command Log Window, you will find the “Remote Control File Path” field. This field lets you specify and store a Lua script file path. This was in part designed to make bridge-scripting easier, but it can be used for anything from a preferences script to a lightmap or other script.
If said file path is specified, and the Monitor button is pressed, script will be run each time the script-file’s file’s date stamp (when the external application updates/ changes). This means you can make it possible to control RizomUV Standalone remotely from another application or other text editor, should you wish to.
Using the CFi flag
CCFI stands for Control File Immediate.
It means the script executes when RizomUV starts and when the file changes. You can also use the CF-flag, which signifies the script only executes when the file changes
When starting RizomUV, the startup flag “cfi” followed by a Lua script path, allows you to specify the remote control file:
/Path/To/rizomuv -cfi /path/to/script_file.lua
The script will then be executed when RizomUV finishes initialising, and will also be run each time the script file’s date stamp changes (when you i.e. add a new parameter or edit it and press save)