Script Preferences

Enter scripts or script commands using the Script Editor. They are executed on each startup. For further information, please refer to the VRED Python Documentation found in Help > Python Documentation.

In the Menu Bar, select Edit > Preferences, then on the left side of the dialog box, select General Settings > Script. After making any changes, press Apply and Save to save them.

Script preferences

Python Sandbox

To avoid the execution of Python commands that can arbitrarily call operating system commands during file load, we implemented a Python sandbox. It can be configured in Preferences > Script. By default, the sandbox is enabled, blocking the following operations:

If a Python script contained in a project file tries to process one of these operations, a warning dialog is displayed. The operation can then manually be allowed or blocked.

If Apply this action to all future instances is selected, it applies the selected action to all subsequent occurrences of the same command.

Selecting the action, Allow for this project, allows the operation until a new scene is called or another project file is loaded.

Selecting Don’t execute blocks the operation and a Python exception is thrown.

Note:

In addition to the preferences, the sandbox can also be controlled with command line options and an environment variable.

  • Use -insecure_python to completely switch off the sandbox.
  • Use -force_secure_python to force the sandbox to be switched on.
  • Set the environment variable, VRED_SECURE_PYTHON, to force the sandbox to be switched on.

Compatibility

Script

Contains shortcut key combinations and Python scripts for some features.