...
In most cases, the scripts can be copied and pasted to RealFlow's scripting editor, but you have to make adjustments and changes to adapt a script to your scene:
Node Names
The names of the nodes (domains, objects, daemons, etc.) have to be exactly the same in the scene and the script. If the names differ you will get errors and the script cannot be executed, e.g.
...
If you change a node's name in the scene, the appropriate name has to be applied to the script as well, and vice versa.
Indents and Leading Spaces
Python scripts require a certain formatting and this is mandatory. The presented scripts are pre-formatted have leading spaces and indents:
- The indents and tabs in your script must be exactly the same as in the examples shown here.
- Whenever you see a colon (:) followed by a line break you have to insert an indent in the form of a tab.
- Missing or false indents are the most common source of syntax errors.
Version-Specific Differences
All scripts, shown here, have been developed on and for RealFlow 10. There are version-specific differences such as
- Associated parameter names in RealFlow do not use theĀ
@
prefix as in previous versions - The old
scene.getEmitter("emitter_name")
notation is no longer valid (since RealFlow 2013). - Very old scripts with "
def onFramesPost()
" or "def onSimulationPre()
", etc. should be adapted to RealFlow's "Simulation Flow" scripting workflow.
Modules
In some scripts you will see import
commands followed by math
or random
. These, so-called modules, are external extensions and they are part of RealFlow's Python distribution. This means they are pre-installed.
...