Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Menu Bar > Layout > Simulation Events (Ctrl + F2)

 

The first impression shows a split window. The upper part consists of a tree with 3 higher-ranking entries:

  1. SimulationPre
  2. Frames
  3. SimulationPost

 

Image Added

 

“Frames” also carries a little “+” or “-” symbol, indicating that this menu can be expanded or collapsed. The branches of the tree are where you can place your own scripts and directly determine when they will be executed. This tree also represents the internal hierarchy:

...

Simulation events can carry more than one script. It is possible to add one or more scripts for any event that wears a “Pre” or “Post” suffix. The scripts can be appended by choosing the desired event, e.g. "FramesPre", and right-clicking on it. This action opens a context menu with some entries:

 

Image Added

 

The first menu in the previous image shows the entries without any attached scripts. The second menu also provides a “Remove” function to delete existing scripts from the tree. By clicking on “Add Script” a new editor window is opened and a new entry becomes visible in the pipeline, similar to the ones in the image on the right.

This name is generated automatically and has a successive ID. Of course, it is possible to change this name to a more project-related label. To do so, close the script editor and double click on the name to make it editable. You can now enter a new description. With this pipeline you always have an overview of which scripts are called at a certain event, but that is not the only advantage: You also no longer need very long and extended scripts, because you have the possibility to put each function into an individual script and reuse it somewhere else. Another strong feature is that it is possible to shift script nodes from one event to another. In situations where it is better to start a calculation after a frame has been finished instead of executing it before, you don’t do not need to copy and paste the scripts. You can simply drag the desired script from “FramePre” to “FramePost” and that is it.

...

To run a simulation without a certain script, it is not necessary to delete it. You can just set it to inactive by unticking the appropriate checkbox.

 

Image Added

RealFlow's tree for events scripts.

 

Once a script has been stored, it can be used again and again. You can also load a script from another source, e.g. RealFlow’s scripting homepage. With “Add Script From File” a script can be imported. Please keep in mind that external scripts usually have to be adjusted to your needs and nodes. A completely new function is the “Add From Plugin” option. With this method it is possible to choose a custom plug-in from the "Command Plugins" manager, where you will find all available plug-ins. The “Expand All” button simply expands all branches from the scripts pipeline marked with the “+” symbol.

...

The execution of a simulation events script can be very time consuming, depending on the complexity of your script and the performed calculations. You will also see a significant drop in simulation speed with scripts, mainly with events scripts (Python is single-threaded).