Viz Artist User Guide

Version 5.0 | Published December 20, 2022 ©

Create Script-based Plug-ins

images/download/thumbnails/95404089/image2020-9-2_11-54-0.png images/download/thumbnails/95404089/image2020-9-2_11-54-13.png

Scene Plug-ins and Container Plug-ins can be created, saved and used again in other Scenes or Containers. To do this create a plug-in of the created script. Script-based plug-ins that you create are saved as .vsl files at <viz data folder>\Scriptplugins, and are available in these folders:

  • Container Plugins > ScriptPlugins

  • Scene Plugins > ScriptPlugins

Script-based plug-ins can be used in the same way as Scene or Container plug-ins.

Tip: Script plug-ins are ordinary text files. If you want to change the Folder they appear in, edit the .vsl file and change the foldername in RegisterPluginFolder("ScriptPlugins").

To Name Your Script

To identify your plug-in for commands or for example as an actor in the stage, you can give your plug-in a unique name by enter a name on the top of the script user interface.

This adds some description code to your .vsl plugin and store the plugin in %ProgramData%\vizrt\VizEngine\ScriptPlugins.

sub OnInitPlugin()
    RegisterPlugin("Script")  ←Name of Plugin
    RegisterPluginFolder("ScriptPlugins")    ← Name of PluginFolder
end sub

To Create a Script-based Plug-in


  1. Create a script.

  2. Click Compile and Run.

  3. If the script compile successfully the Add as Plugin button gets enabled.

  4. Click the Add as Plugin button.

  5. Enter a name for the Script plug-in.

  6. Click OK.

As an alternative, you can drag the script and drop it onto the Plugins Panel. The script is stored automatically in the <viz data folder>\Scriptplugins folder.

To Retrieve the Original Code

To get the original code of a Script-based plug-in, double click it in the Plugins view. The script editor opens in read-only mode, therefore you can not edit and save the plug-in again.


To Edit a Script-based Plug-in

Once your script has been saved as a plug-in, it can not be modified afterwards. However, you can create a new script and drag and drop the plug-in into the script editor. The stored plug-in code is loaded into the script editor. If you save it, you need to give it a new name.

See Also