Prefs - Scripts

Default

The entry in this input field indicates the standard path to the directory where you will store your custom Python scripts. Each time you want to load a script, RealFlow will guide you to this location. With “…” it is possible to specify this path and “Default” restores the default path.

RealFlow Commands File

File

Here you can see/change the path to the “RealFlowCommands.xml” file. This file contains paths and icons for your custom scripts/graphs/plugins and is used with RealFlow’s "Commands Manager". Again, “…” is used to edit the path and “Default” loads the standard settings.

The "RealFlowCommands Environment Variable"

If you are working in a network then it is usually necessary to provide the information from the “RealFlowCommands.xml” file globally for all RealFlow installations. This way, all users will have access to the same collection of scripts and plugins. Of course, it is possible to store the file anywhere and point to it with the “File” button described above. But, for multiple RealFlow licenses this can be a very tedious task. A much more fashionable way is to define an environment variable:

 RF_COMMANDS_FILE_PATH

For example:

RF_COMMANDS_FILE_PATH=/mnt/file_server/realflow/RealFlowCommands.xml

When this variable is defined, all RealFlow installations will look for the “RealFlowCommands.xml” file under the path specified there.

The “commandsOrganizer.dat” File

If you have worked with previous RealFlow versions then there will be the “commandsOrganizer.dat” file. This file contains information about scripts and plugins attached to the GUI. This file still exists in RealFlow 2014, but has been replaced by two XML files (RealFlowCommands.xml and RealFlowShelves.xml). When RealFlow 2014 detects the DAT file, a dialogue appears and you will be asked if you want to convert your previous settings and import them.

The “UsrToolbars” from RealFlow versions earlier than 2014 will be converted into shelves, and the attached scripts and plugins are added to these shelves as commands.

Coding Assistance

Auto Suggestions

RealFlow's internal Python environment monitors your input and recognizes API keywords. Once RealFlow has found such a keyword, a list pops up containing all available and matching commands. You can select the desired instruction and the keyword is completed automatically.

Insert Function Signature

This feature is closely related to “Auto Suggestions” and, when it is enabled, RealFlow prints out the required data type(s) for a Python command, e.g.:

getCamera( string ) or setVelocity( vector )

The data type is printed in brackets and will be substituted by you with an appropriate entry:

getCamera( "SceneCamera01" ) or setVelocity( Vector.new(1.0, 0.0, 0.0) )

Without “Insert Function Signature”, the brackets would be empty, assuming that you already know which data type you have to enter. To find out more about this topic, please read the "RealFlow Scripting GuideRealFlow Scripting Guide".

Auto Syntax Checking (slow)

A very convenient method to accelerate the debugging process can be found here: this function allows you to control the syntax of a script while writing it. This, of course, requires a certain amount of system resources and can therefore slow down performance.

Format

Script Editor and syntax highlight/Customize...

A click on this button opens a new window where you can specify all settings for the scripting windows look and feel, and especially syntax highlighting colours, as well as “Tab Size”.

 

Syntax (Customize...)

A Python script consists of different elements, keywords and operators. RealFlow lets you define a wide variety of colours to dye the code segments and enhance readability. The result of your colour definitions can be seen in the “Preview” area of the window.

General (Customize...)

Error

To mark a syntax error you can specify an RGB colour here.

Background

If you want to change the colour of the canvas's background, define a colour of your choice.

Tab size

In Python, tabs play a very important role, because they are part of the syntax. To make the Python interpreter recognize these indents, a certain number of blanks are needed. The problem is that, with the default number, the code would become nearly unreadable. With “Tab size” it is possible to define how many blanks per tab RealFlow should use. RealFlow automatically converts the adjusted number into Python's standard formatting, while the script's appearance remains exactly the same.

Another problem with indents occurs when whitespace characters and tabs are mixed, because this will lead to syntax errors – even when your Python code seems to be formally correct. We recommend you stay exclusively with tabs and not use blanks.

Expand tabs

When this option is checked, RealFlow automatically converts the tabs into Python's standard format for blanks. This conversion will only be performed internally and the look of the script inside RealFlow is not affected. When you export a script to a text editor, for example, the expanded tabs will be displayed.

Font

It is possible to use any available system font for RealFlow's scripting environment, but you should choose a so-called monospace font, for example Monaco or Courier. These fonts definitely enhance readability, because each letter or character allocates exactly the same space. This guarantees that you can exactly align variables and statements in the code. A click on the “Font” button opens the operating system's font picker window where you can make all relevant settings. 

Preview

In this canvas you can immediately see and check the previously made settings, for example colours and fonts.

Reset

If you are not satisfied with the settings you have just made, you can restore the previous state with this button.

Restore Defaults

To go back to the standard system settings, use this button. RealFlow will then restore the default colours and fonts.

OK/Cancel

Confirm your adjustments with “OK” or leave this window without saving the settings by clicking on “Cancel”.